Browse Source

修复检测是否初始化时的判断

main
pixel 4 years ago
parent
commit
24bcaf2a28
  1. 4
      web/src/utils/request.js

4
web/src/utils/request.js

@ -65,7 +65,7 @@ service.interceptors.response.use(
if (response.headers["new-token"]) { if (response.headers["new-token"]) {
store.commit('user/setToken', response.headers["new-token"]) store.commit('user/setToken', response.headers["new-token"])
} }
if (response.data.code == 0 || response.headers.success === "true") {
if(response.data.code == 0){
if(response.data.data.needInit){ if(response.data.data.needInit){
Message({ Message({
type:"info", type:"info",
@ -74,6 +74,8 @@ service.interceptors.response.use(
store.commit("user/NeedInit") store.commit("user/NeedInit")
router.push({name:"init"}) router.push({name:"init"})
} }
}
if (response.data.code == 0 || response.headers.success === "true") {
return response.data return response.data
} else { } else {
Message({ Message({

Loading…
Cancel
Save