config.js 618 B

1234567891011121314151617181920
  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 === "release") apis = 1
  10. // else apis = 0
  11. if (envV === "develop") apis = 0
  12. else apis = 1
  13. }
  14. export default apis == 1 ? {
  15. Hhost: "https://shop-api.haocha13.cn/",
  16. } : {
  17. Hhost: "https://shop-api.haocha13.cn/", //正式接口
  18. // Hhost: "https://test-api.haocha13.cn/",
  19. }