fix: 修复登录和刷新token时直接使用响应数据的问题
移除对响应数据中.data的直接引用,改为使用完整响应对象
This commit is contained in:
@@ -105,7 +105,7 @@ export const useTokenStore = defineStore(
|
||||
try {
|
||||
const res = await _login(credentials)
|
||||
console.log('普通登录-res: ', res)
|
||||
await _postLogin(res.data)
|
||||
await _postLogin(res)
|
||||
uni.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'success',
|
||||
@@ -133,7 +133,7 @@ export const useTokenStore = defineStore(
|
||||
console.log('微信登录-code: ', code)
|
||||
const res = await _wxLogin(code)
|
||||
console.log('微信登录-res: ', res)
|
||||
await _postLogin(res.data)
|
||||
await _postLogin(res)
|
||||
uni.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'success',
|
||||
@@ -193,7 +193,7 @@ export const useTokenStore = defineStore(
|
||||
const refreshToken = tokenInfo.value.refreshToken
|
||||
const res = await _refreshToken(refreshToken)
|
||||
console.log('刷新token-res: ', res)
|
||||
setTokenInfo(res.data)
|
||||
setTokenInfo(res)
|
||||
return res
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user