config.js 527 B

123456789101112131415161718
  1. let apis;
  2. if(process.env.UNI_PLATFORM==="h5"){
  3. if(window.location.host==="shop-api.haocha13.cn") apis=1
  4. else apis=0
  5. }else if(process.env.UNI_PLATFORM==="mp-weixin"){
  6. //develop/开发版 trial/体验版 release/正式版
  7. const accountInfo = wx.getAccountInfoSync();
  8. let envV = accountInfo.miniProgram.envVersion;
  9. if(envV==="develop") apis=0
  10. else apis=1
  11. }
  12. export default apis==1?{
  13. Hhost: "https://shop-api.haocha13.cn/v1/",
  14. }:{
  15. Hhost: "https://test-api.haocha13.cn/v1/",
  16. // Hhost: "https://shop-api.haocha13.cn/v1/",
  17. }