perf: prompt and gpt4

This commit is contained in:
archer
2023-05-10 12:03:54 +08:00
parent e3c9b8179e
commit cdf4b9f324
12 changed files with 47 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
import axios, { Method, InternalAxiosRequestConfig, AxiosResponse } from 'axios';
import { clearToken } from '@/utils/user';
import { clearCookie } from '@/utils/user';
import { TOKEN_ERROR_CODE } from '@/service/errorCode';
interface ConfigType {
@@ -58,7 +58,7 @@ function responseError(err: any) {
// 有报错响应
const res = err.response;
if (res.data.code in TOKEN_ERROR_CODE) {
clearToken();
clearCookie();
return Promise.reject({ message: 'token过期重新登录' });
}
}