From a430258a2b2a2cf32a618feb828749b81dd2443e Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Wed, 6 Sep 2023 21:35:59 +0800 Subject: [PATCH] change: axios default setting. --- webui/src/utils/axios.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/webui/src/utils/axios.ts b/webui/src/utils/axios.ts index 02a08602..432f973b 100644 --- a/webui/src/utils/axios.ts +++ b/webui/src/utils/axios.ts @@ -3,15 +3,18 @@ import type { ApiError } from "#/api"; export const axios = Axios.create(); -axios.interceptors.request.use((config) => { - const { auth } = useAuth(); +// axios.interceptors.request.use((config) => { +// const { auth } = useAuth(); +// +// // if (auth.value !== '' && config.headers) { +// // config.headers.Authorization = auth.value; +// // } +// +// return config; +// }); - if (auth.value !== '' && config.headers) { - config.headers.Authorization = auth.value; - } - - return config; -}); +// axios.defaults.baseURL = '/api/v1'; +axios.defaults.withCredentials = true; axios.interceptors.response.use( (res) => {