feat(projects): 添加网络代理

This commit is contained in:
Soybean
2022-03-12 19:32:15 +08:00
parent 8191490f39
commit 094dca961f
24 changed files with 75 additions and 50 deletions

View File

@ -7,10 +7,10 @@ import { fetchUpdateToken } from '../api';
* 刷新token
* @param axiosConfig - token失效时的请求配置
*/
export async function refreshToken(axiosConfig: AxiosRequestConfig) {
export async function handleRefreshToken(axiosConfig: AxiosRequestConfig) {
const { resetAuthStore } = useAuthStore();
const rToken = getRefreshToken();
const { data } = await fetchUpdateToken(rToken);
const refreshToken = getRefreshToken();
const { data } = await fetchUpdateToken(refreshToken);
if (data) {
setToken(data.token);
setRefreshToken(data.refreshToken);