From 0c1919a61a5ba447ee5ab45d487decd9355da98a Mon Sep 17 00:00:00 2001 From: liudong <liudong> Date: 星期一, 05 八月 2024 13:46:57 +0800 Subject: [PATCH] 知识库智能体管理的页面开发和功能开发 --- src/api/interceptor.ts | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/api/interceptor.ts b/src/api/interceptor.ts index aa11c4b..f094164 100644 --- a/src/api/interceptor.ts +++ b/src/api/interceptor.ts @@ -17,7 +17,7 @@ } if (import.meta.env.VITE_API_BASE_URL) { - axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL; + // axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL; } axios.defaults.withCredentials = true; axios.interceptors.request.use( @@ -41,6 +41,8 @@ } config.headers.Authorization = `${authorization}`; } + config.headers.Authorization = + 'ImE4NGQ4ZWNjNGVmYjExZWZiZjRkMDI0MmFjMTIwMDA2Ig.ZqnIBw.ZX7_UxnSBKu8x_riQ5FrHLMAS78'; return config; }, (error) => { @@ -52,11 +54,10 @@ axios.interceptors.response.use( (response: AxiosResponse<HttpResponse>) => { const res = response.data; - // if the custom code is not 20000, it is judged as an error. - if ( + /*if ( (res.retcode && res.retcode !== 0) || - (res.code && res.code !== 20000) + (res.code && res.code !== 20000 && res.code !== 200) ) { Message.error({ content: res.msg || 'Error', @@ -87,7 +88,7 @@ response.config.url === '/base/login' ) { setAuthorization(response.headers.authorization); - } + }*/ return res; }, (error) => { -- Gitblit v1.8.0