[系统用户]增加OTP动态密码二次认证

This commit is contained in:
刘祥超
2020-12-24 17:15:53 +08:00
parent 4136527840
commit bf510edfe4
35 changed files with 532 additions and 137 deletions

View File

@@ -1,16 +1,28 @@
Tea.context(function () {
this.username = "";
this.password = "";
this.passwordMd5 = "";
this.encodedFrom = window.encodeURIComponent(this.from);
this.username = ""
this.password = ""
this.passwordMd5 = ""
this.encodedFrom = window.encodeURIComponent(this.from)
this.isSubmitting = false;
this.showOTP = false
this.isSubmitting = false
this.$delay(function () {
this.$find("form input[name='username']").focus();
this.changePassword();
this.$find("form input[name='username']").focus()
this.changePassword()
});
this.changeUsername = function () {
this.$post("/checkOTP")
.params({
username: this.username
})
.success(function (resp) {
this.showOTP = resp.data.requireOTP
})
}
this.changePassword = function () {
this.passwordMd5 = md5(this.password.trim());
};