mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 14:31:04 +00:00
improve: 接口调试请求域名
This commit is contained in:
parent
b7c2fc03e7
commit
6b5b350b31
@ -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';
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user