refactor(projects): new storage system [新的本地数据存储系统]

This commit is contained in:
Soybean
2022-11-17 01:47:06 +08:00
parent 7a58035514
commit 971915948b
23 changed files with 166 additions and 191 deletions

View File

@@ -2,7 +2,7 @@ import axios from 'axios';
import type { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
import { REFRESH_TOKEN_CODE } from '@/config';
import {
getToken,
localStg,
handleAxiosError,
handleBackendError,
handleResponseError,
@@ -49,7 +49,7 @@ export default class CustomAxiosInstance {
const contentType = handleConfig.headers['Content-Type'] as string;
handleConfig.data = await transformRequestData(handleConfig.data, contentType);
// 设置token
handleConfig.headers.Authorization = getToken();
handleConfig.headers.Authorization = localStg.get('token') || '';
}
return handleConfig;
},