This commit is contained in:
2024-05-07 17:32:46 +08:00
parent 57e9cc8201
commit 4dab2b9866
5 changed files with 170 additions and 137 deletions

View File

@@ -63,10 +63,13 @@ function createService() {
break
case 401:
err("登录状态已过期,需要重新登录")
// 清本地localStorage
// 清本地localStorage
tool.local.clear()
// 移动到网站的根目录-这里不需要因为导航守卫可以返回login页面
if (error.response.data.data.code === 40001) {
if (
error.response.data.data.code === 40001 ||
error.response.data.data.detail === "No active account found with the given credentials"
) {
} else {
window.location.href = "/"
}