From d7a96e70ab45225cc87f01d7d435eab1c169eac4 Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期五, 26 七月 2024 16:29:14 +0800 Subject: [PATCH] fix: 新增短信验证登录 --- src/utils/request.ts | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/utils/request.ts b/src/utils/request.ts index a8f78b5..bf97f7c 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,12 +1,12 @@ import type { AxiosInstance, AxiosRequestConfig } from 'axios'; import axios from 'axios'; import { ElMessage } from 'element-plus'; +import { NO_AUTH_API_LIST } from '../api/ai/chat'; +import { LOGIN_URL, TEL_LOGIN_URL } from '../api/ai/user'; import emitter from './mitt'; import { debounce } from './util'; import { AUTH_URL, MAIN_URL, SECONDARY_URL } from '/@/constants'; import { Local, LoginInfo, Session } from '/@/utils/storage'; -import { LOGIN_URL } from '../api/ai/user'; -import { NO_AUTH_API_LIST } from '../api/ai/chat'; // import JSONbig from 'json-bigint'; //#region ====================== 鍚庣 res.err_code ====================== @@ -48,7 +48,7 @@ // 灏� token 娣诲姞鍒拌姹傛姤鏂囧ご涓� config.headers['hswatersession'] = accessSession; } else { - if (config.url !== LOGIN_URL) { + if (config.url !== LOGIN_URL && config.url !== TEL_LOGIN_URL) { handleNoAuth(config.url); throw '鏉冮檺楠岃瘉澶辫触'; } @@ -88,7 +88,7 @@ if (!serveData.json_ok) { switch (serveData?.err_code) { case ErrorCode.Auth: - if (res.config.url !== LOGIN_URL) { + if (res.config.url !== LOGIN_URL && res.config.url !== TEL_LOGIN_URL) { handleNoAuth(); throw '鏉冮檺楠岃瘉澶辫触'; } @@ -97,7 +97,6 @@ ElMessage.error('鍐呴儴閿欒锛�'); throw '鍐呴儴閿欒'; } - } return res.data; }, -- Gitblit v1.9.3