url参数控制请求的代理指向
This commit is contained in:
@@ -18,6 +18,11 @@ instance.interceptors.request.use(config => {
|
|||||||
} else if (/project\/oms/.test(location.pathname)) {
|
} else if (/project\/oms/.test(location.pathname)) {
|
||||||
config.baseURL = "/omsapi"
|
config.baseURL = "/omsapi"
|
||||||
config.url = config.url.replace(/(app|auth|admin)\//, "")
|
config.url = config.url.replace(/(app|auth|admin)\//, "")
|
||||||
|
} else if (/#url-/.test(location.hash)) {
|
||||||
|
config.baseURL = location.hash.replace(/#url-/, '/')
|
||||||
|
if (["/xsjr", "/omsapi"].includes(config.baseURL)) {
|
||||||
|
config.url = config.url.replace(/(app|auth|admin)\//, "")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
}, error => Message.error(error))
|
}, error => Message.error(error))
|
||||||
|
|||||||
Reference in New Issue
Block a user