fix: 修复登录和刷新token时直接使用响应数据的问题

移除对响应数据中.data的直接引用,改为使用完整响应对象
This commit is contained in:
feige996
2025-09-16 09:37:45 +08:00
parent 2179f8e3ac
commit 61fb851fa3

View File

@@ -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) {