重新修改登录逻辑
This commit is contained in:
@ -56,8 +56,6 @@ const alovaInstance = createAlova({
|
||||
}
|
||||
|
||||
const { config } = method
|
||||
console.log("🚀 ~ config.meta?.ignoreAuth:", config)
|
||||
|
||||
const ignoreAuth = !config.meta?.ignoreAuth
|
||||
console.log('ignoreAuth===>', ignoreAuth)
|
||||
// 处理认证信息 自行处理认证问题
|
||||
@ -71,6 +69,10 @@ const alovaInstance = createAlova({
|
||||
const userStore = useUserStore()
|
||||
const { token } = userStore.userInfo as unknown as IUserInfo
|
||||
if (!token) {
|
||||
toast.info('请先登录')
|
||||
setTimeout(() => {
|
||||
uni.switchTab({ url: '/pages/my/my' })
|
||||
}, 500)
|
||||
throw new Error('[请求错误]:未登录')
|
||||
}
|
||||
method.config.headers.token = token;
|
||||
|
||||
Reference in New Issue
Block a user