mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-02 09:50:24 +08:00
使用本地SID二次校验增强管理系统安全性
This commit is contained in:
@@ -39,14 +39,21 @@ Tea.context(function () {
|
||||
};
|
||||
|
||||
this.submitSuccess = function (resp) {
|
||||
if (resp.data.requireOTP) {
|
||||
window.location = "/index/otp?sid=" + resp.data.sid + "&remember=" + (resp.data.remember ? 1 : 0) + "&from=" + window.encodeURIComponent(this.from)
|
||||
return
|
||||
}
|
||||
if (this.from.length == 0) {
|
||||
window.location = "/dashboard";
|
||||
} else {
|
||||
window.location = this.from;
|
||||
}
|
||||
// store information to local
|
||||
localStorage.setItem("sid", resp.data.localSid)
|
||||
localStorage.setItem("ip", resp.data.ip)
|
||||
|
||||
// redirect back
|
||||
this.$delay(function () {
|
||||
if (resp.data.requireOTP) {
|
||||
window.location = "/index/otp?sid=" + resp.data.sid + "&remember=" + (resp.data.remember ? 1 : 0) + "&from=" + window.encodeURIComponent(this.from)
|
||||
return
|
||||
}
|
||||
if (this.from.length == 0) {
|
||||
window.location = "/dashboard";
|
||||
} else {
|
||||
window.location = this.from;
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user