谢杰标 2 gadi atpakaļ
vecāks
revīzija
4e690c6e05
2 mainītis faili ar 25 papildinājumiem un 17 dzēšanām
  1. 19 13
      common/config.js
  2. 6 4
      pages/index/index.vue

+ 19 - 13
common/config.js

@@ -1,27 +1,27 @@
 
 
 // test 测试环境
 // test 测试环境
 const test = {
 const test = {
-    // BASE_URL: 'https://test.xyyxt.net', //预发布
-    // BASE_URL: 'https://api.xyyxt.net', //正式
-    // BASE_URL: 'http://192.168.1.24:5055',
     BASE_URL: 'http://120.79.166.78:19012',
     BASE_URL: 'http://120.79.166.78:19012',
     BASE_IMG_URL: 'https://file-dev.xyyxt.net/',
     BASE_IMG_URL: 'https://file-dev.xyyxt.net/',
     WEBVIEW_URL: 'http://120.79.166.78:18001/',
     WEBVIEW_URL: 'http://120.79.166.78:18001/',
     domain: 'h.xyyxt.net',
     domain: 'h.xyyxt.net',
     tenantId: '867735392558919680', //详粤云学堂
     tenantId: '867735392558919680', //详粤云学堂
-    // tenantId: '667735392758919630', //详粤学堂
-    // tenantId: '867735392558919520', // 勘设云学堂
-    // tenantId: '141250585240548145', // 中山云学堂
     appid: 'wxd3c8ae80cf43a305',
     appid: 'wxd3c8ae80cf43a305',
     version: '1.0.2',
     version: '1.0.2',
     TOP_LOGO: '/static/logo2.png',
     TOP_LOGO: '/static/logo2.png',
     SCAN_LOGO: '/static/me/logo.png'
     SCAN_LOGO: '/static/me/logo.png'
 }
 }
-const isdev = process.env.NODE_ENV === 'development'
-const index = 0 // 祥粤云学堂
+let isDev
+// #ifdef H5
+isDev = process.env.NODE_ENV === 'development'
+// #endif
+// #ifdef MP-WEIXIN
+isDev = __wxConfig.envVersion === 'develop'
+// #endif
+// const index = 0 // 祥粤云学堂
 // const index = 1 // 祥粤学堂
 // const index = 1 // 祥粤学堂
 // const index = 2 // 勘设云学堂
 // const index = 2 // 勘设云学堂
-// const index = 3 // 中正学堂
+const index = 3 // 中正学堂
 const set = [
 const set = [
     // 祥粤云学堂
     // 祥粤云学堂
     {
     {
@@ -31,6 +31,7 @@ const set = [
         domain: 'h.xyyxt.net',
         domain: 'h.xyyxt.net',
         tenantId: '867735392558919680',
         tenantId: '867735392558919680',
         appid: 'wxd3c8ae80cf43a305',
         appid: 'wxd3c8ae80cf43a305',
+        tenantName: '祥粤云学堂',
         version: '1.0.2',
         version: '1.0.2',
         TOP_LOGO: '/static/logo2.png',
         TOP_LOGO: '/static/logo2.png',
         SCAN_LOGO: '/static/me/logo.png'
         SCAN_LOGO: '/static/me/logo.png'
@@ -43,7 +44,10 @@ const set = [
         domain: '',
         domain: '',
         tenantId: '667735392758919630',
         tenantId: '667735392758919630',
         appid: 'wx871153afc95f55f4',
         appid: 'wx871153afc95f55f4',
-        version: '1.0.2'
+        tenantName: '祥粤学堂',
+        version: '1.0.2',
+        TOP_LOGO: '/static/logo2.png',
+        SCAN_LOGO: '/static/me/logo.png'
     },
     },
     // 勘设云学堂
     // 勘设云学堂
     {
     {
@@ -53,22 +57,24 @@ const set = [
         domain: '',
         domain: '',
         tenantId: '567735392758918520',
         tenantId: '567735392758918520',
         appid: 'wx29d0ad81e625ad81',
         appid: 'wx29d0ad81e625ad81',
+        tenantName: '勘设云学堂',
         version: '1.0.2',
         version: '1.0.2',
         TOP_LOGO: '/static/logo520.png',
         TOP_LOGO: '/static/logo520.png',
         SCAN_LOGO: '/static/me/logo520.png'
         SCAN_LOGO: '/static/me/logo520.png'
     },
     },
-    // 中正学堂
+    // 中正学堂
     {
     {
-        BASE_URL: 'https://h.gdzzkj.net',
+        BASE_URL: 'https://api.xyyxt.net',
         BASE_IMG_URL: 'https://file.xyyxt.net/',
         BASE_IMG_URL: 'https://file.xyyxt.net/',
         WEBVIEW_URL: 'https://live.gdzzkj.net/',
         WEBVIEW_URL: 'https://live.gdzzkj.net/',
         domain: 'h.gdzzkj.net',
         domain: 'h.gdzzkj.net',
         tenantId: '141250585240548145',
         tenantId: '141250585240548145',
         appid: 'wx5872ef563d13dabf',
         appid: 'wx5872ef563d13dabf',
+        tenantName: '中正云学堂',
         version: '1.0.2',
         version: '1.0.2',
         TOP_LOGO: '/static/logo145.png',
         TOP_LOGO: '/static/logo145.png',
         SCAN_LOGO: '/static/me/logo145.png'
         SCAN_LOGO: '/static/me/logo145.png'
     }
     }
 ]
 ]
-export default isdev ? test : set[index]
+export default !isDev ? test : set[index]
 
 

+ 6 - 4
pages/index/index.vue

@@ -440,7 +440,7 @@ export default {
       },
       },
     });
     });
   },
   },
-  async onShow() {
+  onShow() {
     // #ifdef H5
     // #ifdef H5
     if (location.search) {
     if (location.search) {
       console.log("url值:", location.search);
       console.log("url值:", location.search);
@@ -454,9 +454,11 @@ export default {
     } else {
     } else {
       // 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名
       // 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名
       // h.gdzzkj.net
       // h.gdzzkj.net
-      if (!uni.getStorageSync("h5_code")) {
-        // location.replace("https://www.xyyxt.net/?ask_type=" + config.domain);
-        return;
+      if (
+        !uni.getStorageSync("h5_code") &&
+        process.env.NODE_ENV !== "development"
+      ) {
+        location.replace("https://www.xyyxt.net/?ask_type=" + config.domain);
       }
       }
     }
     }
     // #endif
     // #endif