u
This commit is contained in:
1 parent
8408cf779f
commit
25a9e41025
58 files changed
+2079
-6308
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import type { Method } from 'alova'
|
||||
import type { AxiosError } from 'axios'
|
||||
import type { RefreshTokenResult } from '@/types/auth'
|
||||
import { axiosRequestAdapter } from '@alova/adapter-axios'
|
||||
import { createAlova } from 'alova'
|
||||
import { router } from 'expo-router'
|
||||
@@ -62,11 +63,11 @@ const alovaInstance = createAlova({
|
||||
}
|
||||
|
||||
// 调用刷新接口
|
||||
const res = await alovaInstance.Get<ResponseData<string>>('/auth/refresh/token', {
|
||||
const res = await alovaInstance.Get<ResponseData<RefreshTokenResult>>('/auth/refreshToken', {
|
||||
headers: { refreshToken },
|
||||
}).send()
|
||||
|
||||
const newToken = res.data
|
||||
const newToken = res.data.refreshToken
|
||||
|
||||
// 更新 store
|
||||
useUserStore.getState().setUserInfo({
|
||||
|
||||
Reference in new issue
Block a user