Commit f6fdfd30 authored by 赵啸非's avatar 赵啸非

修改部门新增

parent 0c3a7d93
......@@ -32,7 +32,15 @@ instance.interceptors.request.use(config => {
// 动态修改请求地址
config.url = `http://${hostname}:${port}${baseURL}/${config.url}`;
if (config.url.startsWith('/')) {
// 字符串以 / 开头
config.url = `http://${hostname}:${port}${baseURL}${config.url}`;
} else {
config.url = `http://${hostname}:${port}${baseURL}/${config.url}`;
// 字符串不以 / 开头
}
//config.url = `http://${hostname}:${port}${baseURL}/${config.url}`;
//config.data = Qs.stringify(config.data, {arrayFormat: 'repeat', allowDots: true});
//config.data = Qs.stringify(config.data, {arrayFormat: 'indices', allowDots: true});
//brackets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment