Эх сурвалжийг харах

feat: 未登录逻辑调整

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 жил өмнө
parent
commit
0cdda173b2

+ 2 - 6
jydocs-mobile/src/views/details/details.vue

@@ -284,7 +284,7 @@ export default class extends Vue {
   getDown: any
   getShow: any
   getShare: any
-  loginInfo: any
+  loginInfo: any = sessionStorage.getItem('jy-login-info')
   links = ''
   docIds = ''
   fixed = false
@@ -339,10 +339,6 @@ export default class extends Vue {
     this.onList()
   }
 
-  mounted () {
-    this.loginInfo = sessionStorage.getItem('jy-login-info')
-  }
-
   get isvipFree () { // 会员免费
     return this.detailData.productType === 1
   }
@@ -437,7 +433,7 @@ export default class extends Vue {
 
   async bottomBtn (type: string) {
     // 未登录跳转登录
-    if (!this.loginInfo || !this.loginInfo.userId) {
+    if (!this.loginInfo) {
       window.location.href = '/jyapp/free/login?to=back'
       return
     }