ArvinQi vor 6 Jahren
Ursprung
Commit
e59b87baa1
1 geänderte Dateien mit 16 neuen und 7 gelöschten Zeilen
  1. 16 7
      pages/cert/type/_id.vue

+ 16 - 7
pages/cert/type/_id.vue

@@ -82,11 +82,7 @@ export default {
   async asyncData({ $axios, params, req }) {
     let id = params.id;
     let headers = req && req.headers;
-    let res = await $axios.$post(
-      `/api/cert/getDetail`,
-      { id },
-      { headers, neverLogout: true }
-    );
+    let res = {};
     let cats = await $axios.$post(
       `/api/cert/get_user_by_cert`,
       { cert_id: id },
@@ -103,7 +99,10 @@ export default {
         detail: {
           conditions: {}
         },
-        workYearOp: 1
+        workYearOp: 1,
+        showCats,
+        showCount,
+        id
       };
     }
     let workYearOp = +data.user_info.work_year_op;
@@ -139,7 +138,17 @@ export default {
       return !this.detail.can_click;
     }
   },
-  mounted() {},
+  async mounted() {
+    if (!this.detail) {
+      let res = await $axios.$post(
+        `/api/cert/getDetail`,
+        { id: this.$route.params.id },
+        { neverLogout: true }
+      );
+      this.detail = res.data;
+      this.workYearOp = +res.data.user_info.work_year_op;
+    }
+  },
   methods: {
     // async loadData(cert_id) {
     //   const res = await this.$axios.$post("", {});