|
|
@@ -1,6 +1,8 @@
|
|
|
import store from 'store';
|
|
|
import { getUrlParam, getFirstHost } from '@/cool/utils';
|
|
|
|
|
|
+const env = process.env;
|
|
|
+
|
|
|
// 路由模式
|
|
|
const routerMode = 'hash';
|
|
|
|
|
|
@@ -8,7 +10,7 @@ const routerMode = 'hash';
|
|
|
const imgHostUrl = `${window.location.protocol}//img.${getFirstHost()}.com`;
|
|
|
|
|
|
// 请求地址
|
|
|
-const baseUrl = (function() {
|
|
|
+const baseUrl = (() => {
|
|
|
let proxy = getUrlParam('proxy');
|
|
|
console.log('proxy', proxy);
|
|
|
|
|
|
@@ -18,12 +20,12 @@ const baseUrl = (function() {
|
|
|
proxy = store.get('proxy') || 'dev';
|
|
|
}
|
|
|
|
|
|
- switch (process.env.NODE_ENV) {
|
|
|
+ switch (env.NODE_ENV) {
|
|
|
case 'development':
|
|
|
return `/${proxy}`;
|
|
|
case 'production':
|
|
|
- // return `http://api.s.huaml.com`;
|
|
|
- return `${window.location.protocol}//api.s.${getFirstHost()}.com`;
|
|
|
+ // return `http://api.b.huaml.com`;
|
|
|
+ return `${window.location.protocol}//api.b.${getFirstHost()}.com`;
|
|
|
default:
|
|
|
return '';
|
|
|
}
|
|
|
@@ -32,4 +34,4 @@ const baseUrl = (function() {
|
|
|
// 阿里字体图标库 https://at.alicdn.com/t/**.css
|
|
|
const iconfontUrl = ``;
|
|
|
|
|
|
-export { routerMode, baseUrl, iconfontUrl, imgHostUrl };
|
|
|
+export { env, routerMode, baseUrl, iconfontUrl, imgHostUrl };
|