修复接口,模块引用等一些问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {Message} from 'element-ui'
|
||||
import instance from '../../ui/lib/js/request'
|
||||
import instance from 'dui/lib/js/request'
|
||||
|
||||
let baseURLs = {
|
||||
production: "/",
|
||||
@@ -8,31 +8,7 @@ let baseURLs = {
|
||||
instance.defaults.baseURL = baseURLs[process.env.NODE_ENV]
|
||||
instance.interceptors.request.use(config => {
|
||||
if (config.url.startsWith("/node")) {
|
||||
config.baseURL = "/ns"
|
||||
} else if (config.url.startsWith("/sse")) {
|
||||
config.baseURL = "/"
|
||||
} else if (/\/project\/activeAnalysis/.test(location.pathname)) {
|
||||
config.baseURL = "/analysis"
|
||||
} else if (/\/project\/beta/.test(location.pathname)) {
|
||||
config.baseURL = "/wg"
|
||||
} else if (/\/project\/sass/.test(location.pathname)) {
|
||||
config.baseURL = "/saas"
|
||||
} else if (/\/tianfuxing/.test(location.pathname)) {
|
||||
config.baseURL = "/tfx"
|
||||
} else if (/\/qianxinan/.test(location.pathname)) {
|
||||
// config.baseURL = "/qxn"
|
||||
} else if (/\/xiushan/.test(location.pathname)) {
|
||||
config.baseURL = "/xsjr"
|
||||
} else if (/project\/oms/.test(location.pathname)) {
|
||||
config.baseURL = "/omsapi"
|
||||
} else if (/#url-/.test(location.hash)) {
|
||||
config.baseURL = location.hash.replace(/#url-/, '/')
|
||||
}
|
||||
if (["/xsjr", "/tfx", "/omsapi"].includes(config.baseURL)) {
|
||||
config.url = config.url.replace(/(app|auth|admin|api)\//, "api/")
|
||||
}
|
||||
if (['/qxn', '/analysis'].includes(config.baseURL)) {
|
||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
||||
config.url = "/ns" + config.url
|
||||
}
|
||||
if (process.env.VUE_APP_IS_SIMPLE_SERVER == 1) {
|
||||
config.url = config.url.replace(/(app|auth|admin)\//, "api/")
|
||||
|
||||
Reference in New Issue
Block a user