shish 2 年之前
父節點
當前提交
782daca757
共有 4 個文件被更改,包括 8 次插入3 次删除
  1. 1 0
      hdApp/src/config.js
  2. 5 3
      hdApp/src/constant/index.js
  3. 1 0
      开发/hdApp/src/config.js
  4. 1 0
      线上/hdApp/src/config.js

+ 1 - 0
hdApp/src/config.js

@@ -1,4 +1,5 @@
 export const ProjectName = 'hd'
 export const APIHOST = 'https://api.shop.huaml.com'
+export const FORMALHOST = 'https://shop.huaml.com'
 export const IMGHOST = 'https://img.huaml.com'
 export const CURRENT_ENV = 'dev'

+ 5 - 3
hdApp/src/constant/index.js

@@ -1,4 +1,4 @@
-import { ProjectName,APIHOST,IMGHOST } from '@/config'
+import { ProjectName,APIHOST,IMGHOST,FORMALHOST } from '@/config'
 
 // #ifdef MP-WEIXIN
 const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
@@ -26,9 +26,11 @@ const envVal = {
 	firstHost: ''
 }
 
+
+
 // #ifdef H5
-envVal.formal = process.env.NODE_ENV == 'development' ? '/api' : `${window.location.protocol}//${window.location.host}`
-envVal.hostUrl = process.env.NODE_ENV == 'development' ? '/api' : `${window.location.protocol}//api.${window.location.host}`
+envVal.formal = process.env.NODE_ENV == 'development' ? '/api' : FORMALHOST
+envVal.hostUrl = process.env.NODE_ENV == 'development' ? '/api' : APIHOST
 // #endif
 
 export default envVal

+ 1 - 0
开发/hdApp/src/config.js

@@ -1,4 +1,5 @@
 export const ProjectName = 'hd'
 export const APIHOST = 'https://api.shop.huaml.com'
+export const FORMALHOST = 'https://shop.huaml.com'
 export const IMGHOST = 'https://img.huaml.com'
 export const CURRENT_ENV = 'dev'

+ 1 - 0
线上/hdApp/src/config.js

@@ -1,4 +1,5 @@
 export const ProjectName = 'hd'
 export const APIHOST = 'https://api.shop.huahb.cn'
+export const FORMALHOST = 'https://shop.huahb.cn'
 export const IMGHOST = 'https://img.huahb.cn'
 export const CURRENT_ENV = 'production'