feat:天平连接
This commit is contained in:
@@ -130,6 +130,8 @@ http.interceptors.response.use(
|
||||
// $store('user').setToken(response.header.authorization || response.header.Authorization)
|
||||
// }
|
||||
|
||||
const userStore = $store('user')
|
||||
const isLogin = userStore.isLogin
|
||||
response.config.custom.showLoading && closeLoading()
|
||||
|
||||
console.log('response', JSON.parse(JSON.stringify(response.data)))
|
||||
@@ -193,6 +195,9 @@ http.interceptors.response.use(
|
||||
title: msg || response.config.custom.errorMsg,
|
||||
icon: 'none'
|
||||
})
|
||||
if (code === 401) {
|
||||
userStore.logout(true)
|
||||
}
|
||||
}
|
||||
|
||||
if ((code === 0 || code === 200) && response.config.custom.showSuccess) {
|
||||
|
||||
Reference in New Issue
Block a user