From cd0e6fa3a84f3842014b77c18439ba8571a2516e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chaocao=E2=80=9D?= <“haocao@iflytek.com”> Date: Thu, 20 Sep 2018 10:32:45 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0:=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=8A=A8=E6=80=81=E8=BA=AB=E4=BB=BD=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=99=A8=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=86=8D=E6=AC=A1=E7=BB=91=E5=AE=9A=202.?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=8F=AF=E8=A7=A3=E7=BB=91=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=9A=84=E5=8A=A8=E6=80=81=E8=BA=AB=E4=BB=BD=E8=AF=81?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=99=A8=203.=E9=87=8D=E7=BD=AE=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=97=B6=E4=BC=9A=E8=87=AA=E5=8A=A8=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=80=81=E7=9A=84=E5=8A=A8=E6=80=81=E8=BA=AB=E4=BB=BD=E8=AF=81?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=99=A8(=E7=94=A8=E6=88=B7=E5=9C=A8?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=E4=B8=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=88=A0=E9=99=A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/www/teleport/static/js/tp-const.js | 5 +++ .../www/teleport/static/js/user/bind-oath.js | 2 +- .../www/teleport/static/js/user/user-list.js | 18 ++++++++++ server/www/teleport/webroot/app/const.py | 1 + .../webroot/app/controller/__init__.py | 2 ++ .../teleport/webroot/app/controller/user.py | 34 ++++++++++++++++++- server/www/teleport/webroot/app/model/user.py | 6 +++- 7 files changed, 65 insertions(+), 3 deletions(-) mode change 100644 => 100755 server/www/teleport/static/js/tp-const.js mode change 100644 => 100755 server/www/teleport/static/js/user/bind-oath.js mode change 100644 => 100755 server/www/teleport/static/js/user/user-list.js mode change 100644 => 100755 server/www/teleport/webroot/app/const.py mode change 100644 => 100755 server/www/teleport/webroot/app/controller/__init__.py mode change 100644 => 100755 server/www/teleport/webroot/app/controller/user.py mode change 100644 => 100755 server/www/teleport/webroot/app/model/user.py diff --git a/server/www/teleport/static/js/tp-const.js b/server/www/teleport/static/js/tp-const.js old mode 100644 new mode 100755 index 5df2d8b..7a9cdeb --- a/server/www/teleport/static/js/tp-const.js +++ b/server/www/teleport/static/js/tp-const.js @@ -212,6 +212,7 @@ var TPE_CAPTCHA_EXPIRED = 10000; var TPE_CAPTCHA_MISMATCH = 10001; var TPE_OATH_MISMATCH = 10002; var TPE_SYS_MAINTENANCE = 10003; +var TPE_OATH_ALREADY_BIND = 10004; var TPE_USER_LOCKED = 10100; var TPE_USER_DISABLED = 10101; @@ -314,6 +315,10 @@ function tp_error_msg(error_code, message) { case TPE_SYS_MAINTENANCE: msg = '系统维护中'; break; + + case TPE_OATH_ALREADY_BIND: + msg = '该账号已经绑定了身份验证器,如无法使用,请联系管理员重置密码或更换登陆方式'; + break; case TPE_USER_LOCKED: msg = '账号已被锁定'; diff --git a/server/www/teleport/static/js/user/bind-oath.js b/server/www/teleport/static/js/user/bind-oath.js old mode 100644 new mode 100755 index d9f8f42..4e59b8e --- a/server/www/teleport/static/js/user/bind-oath.js +++ b/server/www/teleport/static/js/user/bind-oath.js @@ -182,7 +182,7 @@ $app.on_auth_user = function () { } $app.dom.auth.btn_submit.attr('disabled', 'disabled'); - $tp.ajax_post_json('/user/verify-user', {username: str_username, password: str_password}, + $tp.ajax_post_json('/user/verify-user', {username: str_username, password: str_password, check_bind_oath: true}, function (ret) { $app.dom.auth.btn_submit.removeAttr('disabled'); if (ret.code === TPE_OK) { diff --git a/server/www/teleport/static/js/user/user-list.js b/server/www/teleport/static/js/user/user-list.js old mode 100644 new mode 100755 index 65f0719..fb85bc1 --- a/server/www/teleport/static/js/user/user-list.js +++ b/server/www/teleport/static/js/user/user-list.js @@ -203,6 +203,8 @@ $app.on_table_users_cell_created = function (tbl, row_id, col_key, cell_obj) { $app.dlg_edit_user.show_edit(row_id); } else if (action === 'reset-password') { $app.dlg_reset_password.show_edit(row_id); + } else if (action === 'reset-oath-bind') { + $app._reset_oath_bind(user.id); } else if (action === 'lock') { $app._lock_users([user.id]); } else if (action === 'unlock') { @@ -349,6 +351,7 @@ $app.on_table_users_render_created = function (render) { h.push('
'); h.push('