mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
用户登录token过期处理
This commit is contained in:
parent
83bc6fac65
commit
083daa657d
@ -9,9 +9,12 @@ module.exports = vm => {
|
||||
//可以根据业务情况做相应的处理
|
||||
if (res.data.code === 0) {
|
||||
return res.data
|
||||
} else if(res.data.code === 401) {
|
||||
//用户未登录或登录token已过期
|
||||
vm.$store.commit('clearLoginInfo')
|
||||
} else {
|
||||
console.log(res)
|
||||
//错误信息统一处理
|
||||
//其他错误信息统一处理
|
||||
uni.$u.toast(res.data.msg)
|
||||
return Promise.reject(res)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user