Bladeren bron

修复vipbug

zweizhao 7 jaren geleden
bovenliggende
commit
18c5d1dbf6
2 gewijzigde bestanden met toevoegingen van 13 en 8 verwijderingen
  1. 1 2
      pages/index/cert/id.vue
  2. 12 6
      pages/index/type/vip.vue

+ 1 - 2
pages/index/cert/id.vue

@@ -30,8 +30,7 @@ let canvas = null
 
 export default {
   async asyncData(ctx) {
-    let res = await http.post(`${http.host}/api/cert/getCertDetail`, { cert_no: ctx.query.no })
-    // let res = await http.post(`${ctx.isDev ? '' : http.host}/api/cert/getCertDetail`, { cert_no: ctx.query.no })
+    let res = await http.post(`${ctx.isDev ? '' : http.host}/api/cert/getCertDetail`, { cert_no: ctx.query.no })
     return {
       detail: res.data
     }

+ 12 - 6
pages/index/type/vip.vue

@@ -10,10 +10,6 @@ import pc from '@/components/type/vip/pc'
 import mobile from '@/components/type/vip/mobile'
 
 export default {
-  async asyncData() {
-    let res = await http.post(`${ctx.isDev ? '' : http.host}/api/vip/getList`)
-    return { vipList: res.data }
-  },
   head: {
     title: '会员中心页 - 程序员客栈',
   },
@@ -23,8 +19,7 @@ export default {
   },
   data() {
     return {
-      // ssr 数据
-      vipList: [],
+      vipList: []
     }
   },
   computed: {
@@ -36,6 +31,17 @@ export default {
       return this.vipList[1];
     }
   },
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      let res = await http.get(`/api/vip/getList`)
+      if(res) {
+        this.vipList = res.data
+      }
+    }
+  }
 }
 </script>