فهرست منبع

更改配置项

谢杰标 2 سال پیش
والد
کامیت
10a1ce5358
3فایلهای تغییر یافته به همراه100 افزوده شده و 38 حذف شده
  1. 92 0
      common/config copy.js
  2. 1 35
      common/config.js
  3. 7 3
      common/request.js

+ 92 - 0
common/config copy.js

@@ -0,0 +1,92 @@
+// test 测试环境
+const test = {
+  BASE_URL: "http://120.79.166.78:19012",
+  BASE_IMG_URL: "https://file-dev.xyyxt.net/",
+  WEBVIEW_URL: "http://120.79.166.78:18001/",
+  domain: "h.xyyxt.net",
+  tenantId: "867735392558919680", //详粤云学堂
+  appid: "wxd3c8ae80cf43a305",
+  version: "1.0.2",
+  TOP_LOGO: "/static/logo2.png",
+  SCAN_LOGO: "/static/me/logo.png",
+  tenantName: "祥粤云学堂",
+  host:
+    process.env.NODE_ENV === "production"
+      ? window.location.host
+      : "120.79.166.78:19012",
+};
+const index = 0; // 测试环境
+// const index = 1 // 祥粤云学堂
+// const index = 2 // 祥粤学堂
+// const index = 3 // 勘设云学堂
+// const index = 4 // 中正云学堂
+// const index = 5 // 山西云学堂
+const set = [
+  test,
+  // 祥粤云学堂
+  {
+    BASE_URL: "https://api.xyyxt.net",
+    BASE_IMG_URL: "https://file.xyyxt.net/",
+    WEBVIEW_URL: "https://m.xyyxt.net/",
+    domain: "h.xyyxt.net",
+    tenantId: "867735392558919680",
+    appid: "wxd3c8ae80cf43a305",
+    tenantName: "祥粤云学堂",
+    version: "1.0.2",
+    TOP_LOGO: "/static/logo2.png",
+    SCAN_LOGO: "/static/me/logo.png",
+  },
+  // 祥粤学堂
+  {
+    BASE_URL: "https://api.xyyxt.net",
+    BASE_IMG_URL: "https://file.xyyxt.net/",
+    WEBVIEW_URL: "https://cm.xyyxt.net/",
+    domain: "",
+    tenantId: "667735392758919630",
+    appid: "wx871153afc95f55f4",
+    tenantName: "祥粤学堂",
+    version: "1.0.2",
+    TOP_LOGO: "/static/logo2.png",
+    SCAN_LOGO: "/static/me/logo.png",
+  },
+  // 勘设云学堂
+  {
+    BASE_URL: "https://api.xyyxt.net",
+    BASE_IMG_URL: "https://file.xyyxt.net/",
+    WEBVIEW_URL: "https://zstcm.xyyxt.net/",
+    domain: "",
+    tenantId: "567735392758918520",
+    appid: "wx29d0ad81e625ad81",
+    tenantName: "勘设云学堂",
+    version: "1.0.2",
+    TOP_LOGO: "/static/logo520.png",
+    SCAN_LOGO: "/static/me/logo520.png",
+  },
+  // 中正云学堂
+  {
+    BASE_URL: "https://api.xyyxt.net",
+    BASE_IMG_URL: "https://file.xyyxt.net/",
+    WEBVIEW_URL: "https://live.gdzzkj.net/",
+    domain: "h.gdzzkj.net",
+    tenantId: "141250585240548145",
+    appid: "wx5872ef563d13dabf",
+    tenantName: "中正云学堂",
+    version: "1.0.2",
+    TOP_LOGO: "/static/logo145.png",
+    SCAN_LOGO: "/static/me/logo145.png",
+  },
+  // 山西云学堂
+  {
+    BASE_URL: "https://api.xyyxt.net",
+    BASE_IMG_URL: "https://file.xyyxt.net/",
+    WEBVIEW_URL: "https://sxlive.gdzzkj.net /",
+    domain: "sxm.gdzzkj.net",
+    tenantId: "471722209971055962",
+    appid: "wx5872ef563d13dabf",
+    tenantName: "山西云学堂",
+    version: "1.0.2",
+    TOP_LOGO: "/static/logo962.png",
+    SCAN_LOGO: "/static/me/logo962.png",
+  },
+];
+export default set[index];

+ 1 - 35
common/config.js

@@ -2,18 +2,9 @@
 const test = {
   BASE_URL: "http://120.79.166.78:19012",
   BASE_IMG_URL: "https://file-dev.xyyxt.net/",
-  WEBVIEW_URL: "http://120.79.166.78:18001/",
   domain: "h.xyyxt.net",
   tenantId: "867735392558919680", //详粤云学堂
-  appid: "wxd3c8ae80cf43a305",
-  version: "1.0.2",
-  TOP_LOGO: "/static/logo2.png",
-  SCAN_LOGO: "/static/me/logo.png",
-  tenantName: "祥粤云学堂",
-  host:
-    process.env.NODE_ENV === "production"
-      ? window.location.host
-      : "120.79.166.78:19012",
+  appid: "wxd3c8ae80cf43a305"
 };
 const index = 0; // 测试环境
 // const index = 1 // 祥粤云学堂
@@ -27,66 +18,41 @@ const set = [
   {
     BASE_URL: "https://api.xyyxt.net",
     BASE_IMG_URL: "https://file.xyyxt.net/",
-    WEBVIEW_URL: "https://m.xyyxt.net/",
-    domain: "h.xyyxt.net",
     tenantId: "867735392558919680",
     appid: "wxd3c8ae80cf43a305",
     tenantName: "祥粤云学堂",
-    version: "1.0.2",
-    TOP_LOGO: "/static/logo2.png",
-    SCAN_LOGO: "/static/me/logo.png",
   },
   // 祥粤学堂
   {
     BASE_URL: "https://api.xyyxt.net",
     BASE_IMG_URL: "https://file.xyyxt.net/",
-    WEBVIEW_URL: "https://cm.xyyxt.net/",
-    domain: "",
     tenantId: "667735392758919630",
     appid: "wx871153afc95f55f4",
     tenantName: "祥粤学堂",
-    version: "1.0.2",
-    TOP_LOGO: "/static/logo2.png",
-    SCAN_LOGO: "/static/me/logo.png",
   },
   // 勘设云学堂
   {
     BASE_URL: "https://api.xyyxt.net",
     BASE_IMG_URL: "https://file.xyyxt.net/",
-    WEBVIEW_URL: "https://zstcm.xyyxt.net/",
-    domain: "",
     tenantId: "567735392758918520",
     appid: "wx29d0ad81e625ad81",
     tenantName: "勘设云学堂",
-    version: "1.0.2",
-    TOP_LOGO: "/static/logo520.png",
-    SCAN_LOGO: "/static/me/logo520.png",
   },
   // 中正云学堂
   {
     BASE_URL: "https://api.xyyxt.net",
     BASE_IMG_URL: "https://file.xyyxt.net/",
-    WEBVIEW_URL: "https://live.gdzzkj.net/",
-    domain: "h.gdzzkj.net",
     tenantId: "141250585240548145",
     appid: "wx5872ef563d13dabf",
     tenantName: "中正云学堂",
-    version: "1.0.2",
-    TOP_LOGO: "/static/logo145.png",
-    SCAN_LOGO: "/static/me/logo145.png",
   },
   // 山西云学堂
   {
     BASE_URL: "https://api.xyyxt.net",
     BASE_IMG_URL: "https://file.xyyxt.net/",
-    WEBVIEW_URL: "https://sxlive.gdzzkj.net /",
-    domain: "sxm.gdzzkj.net",
     tenantId: "471722209971055962",
     appid: "wx5872ef563d13dabf",
     tenantName: "山西云学堂",
-    version: "1.0.2",
-    TOP_LOGO: "/static/logo962.png",
-    SCAN_LOGO: "/static/me/logo962.png",
   },
 ];
 export default set[index];

+ 7 - 3
common/request.js

@@ -8,7 +8,11 @@ export const BASE_URL = config.BASE_URL;
 export let tenantId = config.tenantId; // 祥粤云学堂:867735392558919680,祥粤学堂:667735392758919630, 中建云学堂-567735392758918520
 // #endif
 // #ifdef H5
-export let tenantId = uni.getStorageSync(config.host) || "";
+export const host =
+  process.env.NODE_ENV === "production"
+    ? window.location.host
+    : "120.79.166.78:19012";
+export let tenantId = uni.getStorageSync(host) || "";
 // #endif
 export const myRequest = (options) => {
   if (store.state.allowLoading && !options.noLoading) {
@@ -21,7 +25,7 @@ export const myRequest = (options) => {
     // #ifdef H5
     if (!tenantId) {
       tenantId = await getTenantId();
-      uni.setStorageSync(config.host, tenantId);
+      uni.setStorageSync(host, tenantId);
     }
     // #endif
     let token = uni.getStorageSync("token");
@@ -133,7 +137,7 @@ function getTenantId() {
       url: config.BASE_URL + "/app/common/findTenantId",
       method: "get",
       data: {
-        hostH5: config.host,
+        hostH5: host,
       },
       success: (res) => {
         if (res.data.code == 200) {