improve: 接口调试请求域名

This commit is contained in:
From-wh 2023-05-06 12:09:50 +08:00
parent b7c2fc03e7
commit 6b5b350b31
2 changed files with 2 additions and 9 deletions

View File

@ -15,7 +15,7 @@ service.interceptors.request.use(
let baseUrl = Setting.apiBaseURL.replace(/adminapi/, 'kefuapi');
config.baseURL = baseUrl;
} else {
config.baseURL = 'https://v5.wuht.net/outapi' || Setting.apiBaseURL;
config.baseURL = Setting.apiBaseURL;
}
if (config.file) {
config.headers['Content-Type'] = 'multipart/form-data';

View File

@ -4,8 +4,7 @@ import { getCookies, removeCookies } from '@/libs/util';
import { Message } from 'iview';
const service = axios.create({
baseURL: 'https://v5.wuht.net',
// baseURL: location.protocol + '//'+ location.hostname,
baseURL: location.protocol + '//' + location.hostname,
timeout: 10000, // 请求超时时间
});
axios.defaults.withCredentials = true; // 携带cookie
@ -13,12 +12,6 @@ axios.defaults.withCredentials = true; // 携带cookie
// 请求拦截器
service.interceptors.request.use(
(config) => {
// if (config.kefu) {
// let baseUrl = Setting.apiBaseURL.replace(/adminapi/, 'kefuapi');
// config.baseURL = baseUrl;
// } else {
// config.baseURL = 'https://v5.wuht.net/outapi' || Setting.apiBaseURL;
// }
if (config.file) {
config.headers['Content-Type'] = 'multipart/form-data';
} else {