Sfoglia il codice sorgente

api 获取app的下载权限和地址

Michael Wang 5 anni fa
parent
commit
71264a0c02
2 ha cambiato i file con 24 aggiunte e 5 eliminazioni
  1. 9 4
      src/components/MainLayout/MainLayout.vue
  2. 15 1
      vue.config.js

+ 9 - 4
src/components/MainLayout/MainLayout.vue

@@ -124,6 +124,7 @@ export default {
   data() {
     return {
       appDownloadUrl: "fetching...",
+      ifShowQr: false,
     };
   },
   computed: {
@@ -140,10 +141,10 @@ export default {
         identityNumber,
       });
     },
-    ifShowQr() {
-      const shouldShow = this.QECSConfig.SHOW_STUDENT_CLIENT_APP_QRCODE;
-      return shouldShow === "true";
-    },
+    // ifShowQr() {
+    //   const shouldShow = this.QECSConfig.SHOW_STUDENT_CLIENT_APP_QRCODE;
+    //   return shouldShow === "true";
+    // },
     getLogo() {
       return this.isEpcc
         ? require("./epcc-logo.png")
@@ -155,6 +156,10 @@ export default {
       "/api/ecs_core/systemProperty/APP_DOWNLOAD_URL"
     );
     this.appDownloadUrl = r.data;
+    const r2 = await this.$http.get(
+      `/api/ecs_core/org/property/${this.user.rootOrgId}/APP_ENABLED`
+    );
+    this.ifShowQr = r2.data;
   },
   methods: {
     goChangePwd() {

+ 15 - 1
vue.config.js

@@ -167,7 +167,21 @@ module.exports = {
           },
         },
         {
-          // 客观分10分钟更新一次
+          // APP是否下载1分钟更新一次
+          urlPattern: /\/api\/ecs_core\/org\/property\/\d+\/APP_ENABLED/,
+          handler: "cacheFirst",
+          options: {
+            cacheableResponse: {
+              statuses: [0, 200],
+            },
+            cacheName: "app-alllow-download-cache",
+            expiration: {
+              maxAgeSeconds: 1 * 60,
+            },
+          },
+        },
+        {
+          // APP下载地址10分钟更新一次
           urlPattern: /\/api\/ecs_core\/systemProperty\/APP_DOWNLOAD_URL/,
           handler: "cacheFirst",
           options: {