|
@@ -1,71 +1,20 @@
|
|
let httpApi = ""; // 基础服务
|
|
let httpApi = ""; // 基础服务
|
|
let doorplateImgUrl='';// 门牌二维码图片地址
|
|
let doorplateImgUrl='';// 门牌二维码图片地址
|
|
//根据运行时版本设置请求url
|
|
//根据运行时版本设置请求url
|
|
-function setFetchUrlByEnv(env) {
|
|
|
|
-// httpApi = "http://192.168.31.51:9080"; //公司测试
|
|
|
|
- httpApi = "https://fhszmp.fh.gov.cn:9080"; //线上测试
|
|
|
|
-// httpApi = "https://fhszmp.fh.gov.cn:8080"; //线上正式
|
|
|
|
- doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
|
|
|
|
-
|
|
|
|
-// console.log("当前运行", env);
|
|
|
|
-// if (env === "development") {
|
|
|
|
-//// httpApi = "http://192.168.31.51:9080";
|
|
|
|
-// httpApi = "http://122.247.77.37:9080";
|
|
|
|
-// doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
|
|
|
|
-// } else {
|
|
|
|
-// httpApi = "https://zlszmp.fh.gov.cn:8088/digital-doorplate";
|
|
|
|
-// doorplateImgUrl='https://zlszmp.fh.gov.cn:8088/digital-doorplateAddrUrl'
|
|
|
|
-// }
|
|
|
|
-// switch (env) {
|
|
|
|
-// case "develop":
|
|
|
|
-// httpApi = "http://172.18.50.88:8070/digital-doorplate";
|
|
|
|
-// doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
|
|
|
|
-// // 微信小程序开发环境在真机上连接外网体验版地址
|
|
|
|
-// // #ifdef MP-WEIXIN
|
|
|
|
-// if (__wxConfig && __wxConfig.platform !== "devtools") {
|
|
|
|
-// httpApi = "http://60.191.98.34:8072/digital-doorplate";
|
|
|
|
-// }
|
|
|
|
-// // #endif
|
|
|
|
-// break;
|
|
|
|
-// case "trial":
|
|
|
|
-// // 体验版
|
|
|
|
-// // #ifdef MP-WEIXIN
|
|
|
|
-// // httpApi = "http://60.191.98.34:8072/digital-doorplate"; // 基础服务
|
|
|
|
-// httpApi = "https://zlszmp.fh.gov.cn:8088/digital-doorplate"; // 基础服务
|
|
|
|
-// // #endif
|
|
|
|
-// // #ifdef MP-ALIPAY
|
|
|
|
-// httpApi = "https://zlszmp.fh.gov.cn:8088/digital-doorplate"; // 基础服务
|
|
|
|
-// // #endif
|
|
|
|
-// doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
|
|
|
|
-// break;
|
|
|
|
-// case "release":
|
|
|
|
-// // 正式
|
|
|
|
-// httpApi = "'https://fhszmp.fh.gov.cn:8090/digital-doorplate"; // 基础服务
|
|
|
|
-// doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
|
|
|
|
-// break;
|
|
|
|
-// default:
|
|
|
|
-// // httpApi = "http://172.18.50.92:8888/digital-doorplate";
|
|
|
|
-// if (env === "development") {
|
|
|
|
-//// 发版的时候恢复过来
|
|
|
|
-//// httpApi = window.location.origin + "/digital-doorplate"; //"http://172.18.50.92:8888/digital-doorplate";
|
|
|
|
-//// doorplateImgUrl='https://zlszmp.fh.gov.cn:8088/digital-doorplateAddrUrl'
|
|
|
|
-//
|
|
|
|
-//// httpApi = "http://192.168.31.51:9080";
|
|
|
|
-// httpApi = "http://122.247.77.37:9080";
|
|
|
|
-// doorplateImgUrl='https://fhszmp.fh.gov.cn:8090/digital-doorplateAddrUrl'
|
|
|
|
-// } else {
|
|
|
|
-// httpApi = "https://zlszmp.fh.gov.cn:8088/digital-doorplate";
|
|
|
|
-// doorplateImgUrl='https://zlszmp.fh.gov.cn:8088/digital-doorplateAddrUrl'
|
|
|
|
-// }
|
|
|
|
-// break;
|
|
|
|
-// }
|
|
|
|
|
|
+function setFetchUrlByEnv() {
|
|
|
|
+ // 获取当前页面的 URL
|
|
|
|
+ const currentUrl = window.location.href;
|
|
|
|
+ console.log("currentUrl", currentUrl);
|
|
|
|
+ if (currentUrl.includes('debug=true')) {
|
|
|
|
+ httpApi = 'https://fhszmp.fh.gov.cn:9080';
|
|
|
|
+ uni.getEnvVersion = ()=> 'development'
|
|
|
|
+ } else {
|
|
|
|
+ httpApi = 'https://fhszmp.fh.gov.cn:8080';
|
|
|
|
+ uni.getEnvVersion = () => 'production'
|
|
|
|
+ }
|
|
|
|
+ doorplateImgUrl='https://zlszmp.fh.gov.cn:8088/digital-doorplateAddrUrl'
|
|
}
|
|
}
|
|
|
|
|
|
-uni.getEnvVersion = () => {
|
|
|
|
- return process.env.NODE_ENV === "production" ? "production" : "development";
|
|
|
|
-};
|
|
|
|
-const envVersion = uni.getEnvVersion();
|
|
|
|
-
|
|
|
|
-setFetchUrlByEnv(envVersion);
|
|
|
|
|
|
+setFetchUrlByEnv();
|
|
|
|
|
|
export { httpApi, doorplateImgUrl};
|
|
export { httpApi, doorplateImgUrl};
|