diff --git a/src/services/utils.js b/src/services/utils.js index a261937..22a5f46 100644 --- a/src/services/utils.js +++ b/src/services/utils.js @@ -7,24 +7,25 @@ const isDev = process.env.NODE_ENV === 'development'; // 开发 or 生产 // 匹配接口前缀 export function autoMatch (prefix) { - let baseUrl = `/${prefix || 'fumao'}`; - // if (isDev) { - // // 开发环境 通过proxy配置转发请求; - // baseUrl = `/${prefix || 'fumao'}`; - // } else { - // // 生产环境 根据实际配置 根据 prefix 匹配url; - // // 配置来源 根据实际应用场景更改配置。(1.从全局读取;2.线上配置中心读取) - // switch (prefix) { - // case 'baidu': - // baseUrl = window.LOCAL_CONFIG.baidu; - // break; - // case 'alipay': - // baseUrl = window.LOCAL_CONFIG.alipay; - // break; - // default: - // baseUrl = window.LOCAL_CONFIG.default; - // } - // } + let baseUrl = ``; + if (isDev) { + // 开发环境 通过proxy配置转发请求; + baseUrl = `/${prefix || 'fumao'}`; + } else { + // 生产环境 根据实际配置 根据 prefix 匹配url; + // 配置来源 根据实际应用场景更改配置。(1.从全局读取;2.线上配置中心读取) + // switch (prefix) { + // case 'baseurl': + // baseUrl = window.LOCAL_CONFIG.baseurl; + // break; + // case 'fumao': + // baseUrl = window.LOCAL_CONFIG.fumao; + // break; + // default: + // baseUrl = window.LOCAL_CONFIG.default; + // } + baseUrl = `/${prefix || 'fumao'}`; + } return baseUrl; } diff --git a/vue.config.js b/vue.config.js index 1e97682..192bf96 100644 --- a/vue.config.js +++ b/vue.config.js @@ -20,7 +20,7 @@ module.exports = { } }, '/fumao': { - target: 'https://btest.malls.iformall.com/B', + target: 'https://bh5test.malls.iformall.com/B', changeOrigin: true, pathRewrite: { '^/fumao': ''