修复更改密码后错误的页面跳转
This commit is contained in:
parent
0442dc3256
commit
e55cb6082a
@ -71,13 +71,15 @@ function ChangePasswd() {
|
|||||||
if (pass.pass1 != pass.pass2) return
|
if (pass.pass1 != pass.pass2) return
|
||||||
if (load) return
|
if (load) return
|
||||||
setLoad(true)
|
setLoad(true)
|
||||||
changePasswd(pass.old, pass.pass1, nowToken).catch(e => {
|
changePasswd(pass.old, pass.pass1, nowToken)
|
||||||
|
.then(() => [navigate("/login"), setToken(""), setUser({ name: "", uuid: "" })])
|
||||||
|
.catch(e => {
|
||||||
if (e instanceof ApiErr && e.code == 6) {
|
if (e instanceof ApiErr && e.code == 6) {
|
||||||
setOldPassErr(true)
|
setOldPassErr(true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setLayoutErr(String(e))
|
setLayoutErr(String(e))
|
||||||
}).finally(() => setLoad(false)).then(() => [navigate("/login"), setToken(""), setUser({ name: "", uuid: "" })])
|
}).finally(() => setLoad(false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user