config.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // 配置文件
  2. const env = wx.getAccountInfoSync().miniProgram;
  3. // 请求根路径
  4. let baseUrl = "http://8.136.199.33:8500/api",
  5. pcUrl,
  6. reportLinkUrl,
  7. intemalLinkUrl,
  8. reportStrategyUrl;
  9. if (env.envVersion === "develop") {
  10. //开发
  11. baseUrl = "http://8.136.199.33:8500/api";
  12. pcUrl = "https://cygxpctest.hzinsights.com/cygx_pc";
  13. reportLinkUrl = "http://xcxh5test.hzinsights.com/xcx_h5/raiReportDtl";
  14. intemalLinkUrl = "http://xcxh5test.hzinsights.com/xcx_h5/internalDetials";
  15. reportStrategyUrl = "http://xcxh5test.hzinsights.com/xcx_h5/strategyReport";
  16. } else if (env.envVersion === "trial") {
  17. //体验版
  18. baseUrl = "https://cygxtest.hzinsights.com/api"; // 测试
  19. //baseUrl = "https://cygx.hzinsights.com/api"; //生产
  20. pcUrl = "https://cygxpctest.hzinsights.com/cygx_pc"; // 测试
  21. //pcUrl = "https://cygxpc.hzinsights.com/cygx_pc"; //生产
  22. reportLinkUrl = "http://xcxh5test.hzinsights.com/xcx_h5/raiReportDtl"; //测试
  23. //reportLinkUrl = "https://details.hzinsights.com/raiReportDtl"; //生产
  24. intemalLinkUrl = "http://xcxh5test.hzinsights.com/xcx_h5/internalDetials";
  25. reportStrategyUrl = "http://xcxh5test.hzinsights.com/xcx_h5/strategyReport"; //测试
  26. //reportStrategyUrl = "https://details.hzinsights.com/strategyReport"; //生产
  27. } else if (env.envVersion === "release") {
  28. //正式版
  29. baseUrl = "https://cygx.hzinsights.com/api";
  30. pcUrl = "https://cygxpc.hzinsights.com/cygx_pc"; //生产
  31. reportLinkUrl = "https://details.hzinsights.com/raiReportDtl"; //生产
  32. intemalLinkUrl = "https://details.hzinsights.com/internalDetials";//生产
  33. reportStrategyUrl = "https://details.hzinsights.com/strategyReport"; //生产
  34. }
  35. module.exports = {
  36. baseUrl,
  37. pcUrl,
  38. reportLinkUrl,
  39. reportStrategyUrl,
  40. intemalLinkUrl
  41. };
  42. // #ifdef H5
  43. export const H5baseUrl = process.env.NODE_ENV === "development" ? window.location.origin + "/" : baseUrl;
  44. // #endif