可信开源代码库-AI大模型登录状态异常处理及添加接口提示

This commit is contained in:
付民康
2025-07-22 10:52:39 +08:00
parent 3a9fbbf5cc
commit c879d6a276
5 changed files with 20 additions and 23 deletions

View File

@@ -198,7 +198,14 @@ const proxyService = (params: any, customConfigs?: CustomConfigs) => {
// response 拦截器
service.interceptors.response.use(
(response) => {
async (response) => {
const { config } = response || {};
if(response.data.code===500 && !config?.url.includes('/token/refresh') && !config?.url.includes('/api/v1/user/info') ) {
let op_access_token = localStorage.getItem('op_access_token') || '';
let op_refresh_token = localStorage.getItem('op_refresh_token') || '';
// 如果是从blog跳转过来的判断是否登陆如果登陆则写入storage
await account.checkIsLogin(op_access_token,op_refresh_token);
}
response.data.data = $Decrypt(response.data.data)
return response;
},