mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 04:10:27 +08:00
修复异地登录自动验证提交两次的问题
This commit is contained in:
@@ -216,9 +216,11 @@ func (this *userMustAuth) BeforeAction(actionPtr actions.ActionWrapper, paramNam
|
|||||||
this.login(action)
|
this.login(action)
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
// TODO 考虑IP变化时也需要验证,主要是考虑被反向代理的情形
|
if !lists.ContainsString([]string{"/messages/badge", "/dns/tasks/check", "/clusters/tasks/check"}, action.Request.URL.Path) {
|
||||||
action.RedirectURL("/login/validate?from=" + url.QueryEscape(action.Request.URL.String()))
|
// TODO 考虑IP变化时也需要验证,主要是考虑被反向代理的情形
|
||||||
return false
|
action.RedirectURL("/login/validate?from=" + url.QueryEscape(action.Request.URL.String()))
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ Tea.context(function () {
|
|||||||
|
|
||||||
this.$post("$")
|
this.$post("$")
|
||||||
.params({localSid: sid, "ip": ip})
|
.params({localSid: sid, "ip": ip})
|
||||||
.post()
|
|
||||||
.success(function (resp) {
|
.success(function (resp) {
|
||||||
if (!resp.data.isOk) {
|
if (!resp.data.isOk) {
|
||||||
window.location = "/logout"
|
window.location = "/logout"
|
||||||
@@ -28,7 +27,7 @@ Tea.context(function () {
|
|||||||
} else {
|
} else {
|
||||||
window.location = "/dashboard"
|
window.location = "/dashboard"
|
||||||
}
|
}
|
||||||
})
|
}, 100)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user