Pārlūkot izejas kodu

default inject method check

hare8999@163.com 2 gadi atpakaļ
vecāks
revīzija
6e370bebae

+ 1 - 1
src/views/index/components/index-card-career.vue

@@ -60,7 +60,7 @@ export default {
       })
     },
     async handleMore() {
-      await this.loginCheck()
+      if (this.loginCheck) await this.loginCheck()
       this.transferTo(this.morePath)
     }
   }

+ 2 - 2
src/views/index/components/index-card-news.vue

@@ -65,11 +65,11 @@ export default {
       return this.newsCache[type] || []
     },
     async handleMore() {
-      await this.loginCheck()
+      if (this.loginCheck) await this.loginCheck()
       this.transferTo(this.morePath)
     },
     async goNewsWithType(type) {
-      await this.loginCheck()
+      if (this.loginCheck) await this.loginCheck()
       this.transferTo(this.morePath, { type })
     }
   }

+ 1 - 1
src/views/index/components/index-card-subject-query.vue

@@ -35,7 +35,7 @@ export default {
   },
   methods: {
     async handleMore() {
-      await this.loginCheck()
+      if (this.loginCheck) await this.loginCheck()
       this.transferTo(this.morePath)
     }
   }

+ 1 - 1
src/views/index/components/index-card-top.vue

@@ -42,7 +42,7 @@ export default {
       })
     },
     async handleMore() {
-      await this.loginCheck()
+      if (this.loginCheck) await this.loginCheck()
       this.transferTo(this.morePath)
     }
   }

+ 1 - 1
src/views/index/components/index-image-item.vue

@@ -63,7 +63,7 @@ export default {
   },
   methods: {
     async handleItem() {
-      await this.loginCheck()
+      if (this.loginCheck) await this.loginCheck()
       if (!this.path) return
       this.transferTo(this.path, this.nextData)
     }

+ 1 - 1
src/views/index/components/index-preference-simulate.vue

@@ -18,7 +18,7 @@ export default {
   },
   methods: {
     async handleClick() {
-      await this.loginCheck()
+      if (this.loginCheck) await this.loginCheck()
       this.transferTo(this.path)
     }
   }

+ 1 - 1
src/views/index/components/login-top-menus.vue

@@ -33,7 +33,7 @@ export default {
   },
   methods: {
     async handleMenuClick(item) {
-      await this.loginCheck()
+      if (this.loginCheck) await this.loginCheck()
       this.to(item)
     }
   }