打通接口请求

This commit is contained in:
MaxShen
2025-03-18 15:43:07 +08:00
parent ff6e140045
commit df28f4799a
3 changed files with 11 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import { useGlobalInfoStore } from '@/stores/Global';
import { cutParamsInUrl, getSignUtmSource } from './index';
import { Message } from 'vue-devui/message';
import degradeInterceptor from './degradeInterceptor';
import { useAccountStore } from '@/stores/user';
const handleError = dealWarning();
@@ -67,9 +68,14 @@ const refreshToken = async () => axios.request({
});
const proxyService = (params: any, customConfigs?: CustomConfigs) => {
const account = useAccountStore();
const service = axios.create({
baseURL: params.apiType === 'devApi' ? baseDevURL : baseURL,
timeout: 15000,
headers: {
'DP_TOKEN': account.accountInfo.access_token,
'DP_REFRESH_TOKEN': account.accountInfo.refresh_token,
},
withCredentials: true
});
/** user api相关请求白名单 */