diff --git a/build/builder/build-installer.py b/build/builder/build-installer.py index e7f4fa8..eb682d2 100644 --- a/build/builder/build-installer.py +++ b/build/builder/build-installer.py @@ -73,6 +73,7 @@ class BuilderWin(BuilderBase): utils.copy_ex(out_path, bin_path, 'tp_web.exe') utils.copy_ex(out_path, bin_path, 'tp_core.exe') utils.copy_ex(out_path, bin_path, 'tpssh.dll') + utils.copy_ex(out_path, bin_path, 'tprdp.dll') utils.copy_ex(os.path.join(env.root_path, 'out', 'pysrt'), bin_path, (ctx.dist_path, 'pysrt')) diff --git a/server/www/teleport/app/eom_app/controller/host.py b/server/www/teleport/app/eom_app/controller/host.py index 812f11b..e6279d7 100644 --- a/server/www/teleport/app/eom_app/controller/host.py +++ b/server/www/teleport/app/eom_app/controller/host.py @@ -900,8 +900,12 @@ class SysUserAdd(TPBaseUserAuthJsonHandler): args['user_pswd'] = return_data['data'] - if host.sys_user_add(args) < 0: - return self.write_json(-1) + user_id = host.sys_user_add(args) + if user_id < 0: + if user_id == -100: + return self.write_json(user_id, '同名账户已经存在!') + else: + return self.write_json(user_id, '数据库操作失败!') return self.write_json(0) diff --git a/server/www/teleport/static/js/ui/admin_host.js b/server/www/teleport/static/js/ui/admin_host.js index 9d44f66..d80762d 100644 --- a/server/www/teleport/static/js/ui/admin_host.js +++ b/server/www/teleport/static/js/ui/admin_host.js @@ -669,14 +669,11 @@ ywl.create_host_edit_dlg = function (tbl) { }; dlg_edit_host.on_sys_type_change = function () { dlg_edit_host.sys_type = parseInt($('#auth-sys-type').val()); - console.log('sys-type', dlg_edit_host.sys_type, 'protocol:', dlg_edit_host.protocol); if (dlg_edit_host.sys_type === OS_TYPE_WINDOWS) {// && dlg_edit_host.protocol === 0) { dlg_edit_host.protocol = PROTOCOL_TYPE_RDP; - console.log('--1', dlg_edit_host.protocol); } else if (dlg_edit_host.sys_type === OS_TYPE_LINUX) {// && dlg_edit_host.protocol === 0) { dlg_edit_host.protocol = PROTOCOL_TYPE_SSH; - console.log('--2', dlg_edit_host.protocol); } $('#host-protocol-type').val(dlg_edit_host.protocol); @@ -686,7 +683,6 @@ ywl.create_host_edit_dlg = function (tbl) { dlg_edit_host.on_protocol_change = function () { dlg_edit_host.protocol = parseInt($('#host-protocol-type').val()); - console.log('xx', dlg_edit_host.protocol); if (dlg_edit_host.protocol === PROTOCOL_TYPE_RDP) $('#dlg-edit-host-protocol-port').val('3389'); else if (dlg_edit_host.protocol === PROTOCOL_TYPE_SSH) @@ -1266,7 +1262,7 @@ ywl.create_sys_user = function (tbl) { dlg_sys_user.check_args = function () { dlg_sys_user.auth_mode = parseInt($('#auth-user-type').val()); - dlg_sys_user.user_name = parseInt($('#auth-user-host-username').val()); + dlg_sys_user.user_name = $('#auth-user-host-username').val(); if (dlg_sys_user.auth_mode !== AUTH_NONE && dlg_sys_user.user_name.length === 0) { ywl.notify_error('请输入系统用户名!');