Переглянути джерело

fix:app端已登录跳转判断不对

zhangsiya 10 місяців тому
батько
коміт
b0df09c383

+ 4 - 1
jydocs-mobile/src/store/modules/main.ts

@@ -80,7 +80,8 @@ const modulesOption: modulesOption = {
     homePageData: recoveryPageData('jy-docs-home-page'),
     searchPageData: recoveryPageData('jy-docs-search-page'),
     userLib: recoveryPageData('jy-docs-user-lib'),
-    loginInfo: {}
+    loginInfo: {},
+    isLogin: false
   },
   mutations: {
     // 保存首页数据
@@ -94,7 +95,9 @@ const modulesOption: modulesOption = {
       state.loginInfo = data.data
       if (data.data.userId) {
         sessionStorage.setItem('jy-login-info', JSON.stringify(data.data))
+        state.isLogin = true
       } else {
+        state.isLogin = false
         sessionStorage.removeItem('jy-login-info')
       }
     },

+ 14 - 16
jydocs-mobile/src/views/details/details.vue

@@ -317,7 +317,7 @@ import '@vue-office/excel/lib/index.css'
   },
   computed: {
     ...mapState('main', {
-      loginInfo: (state: any) => state.loginInfo
+      loginInfo: (state: any) => state.isLogin
     })
   },
   methods: {
@@ -404,7 +404,6 @@ export default class extends Vue {
   docLoadError = false
 
   created () {
-    console.log(this.loginInfo)
     if (this.loginInfo) {
       this.TopConfig.actionRightText = '<div style="display:flex;flex-direction: column;align-items: center;"><i class="j-icon icon-iconJianYu"></i><p style="color: #171826;font-size: 10px;line-height: 12px;margin-top:3px;">分享赚剑鱼币</p></div>'
     }
@@ -846,20 +845,19 @@ export default class extends Vue {
   readAll () {
     console.log(444444444)
     console.log(this.loginInfo)
-    // return
-    // if (this.isvipFree && this.buyed === 0 && this.isviper) { // 会员免费 未下载 会员
-    //   this.getFile()
-    // } else if ((this.power.freeDownload === 2 || this.power.freeDownload === 0) && this.isvipFree && this.buyed === 0 && !this.isviper) {
-    //   this.bottomBtn('使用免费下载特权')
-    // } else if (this.isvipFree && this.buyed === 0 && !this.isviper && this.power.freeDownload === 1) { // 会员免费 未下载 不是会员 使用过免费下载次数
-    //   this.bottomBtn('开通文库会员')
-    // } else if (this.boutique && this.buyed === 0 && this.isviper) {
-    //   this.bottomBtn('会员获取文档')
-    // } else if (this.boutique && this.buyed === 0 && !this.isviper) {
-    //   this.bottomBtn('开通文库会员')
-    // } else if (this.buyed === 1) {
-    //   this.uploaded('down')
-    // }
+    if (this.isvipFree && this.buyed === 0 && this.isviper) { // 会员免费 未下载 会员
+      this.getFile()
+    } else if ((this.power.freeDownload === 2 || this.power.freeDownload === 0) && this.isvipFree && this.buyed === 0 && !this.isviper) {
+      this.bottomBtn('使用免费下载特权')
+    } else if (this.isvipFree && this.buyed === 0 && !this.isviper && this.power.freeDownload === 1) { // 会员免费 未下载 不是会员 使用过免费下载次数
+      this.bottomBtn('开通文库会员')
+    } else if (this.boutique && this.buyed === 0 && this.isviper) {
+      this.bottomBtn('会员获取文档')
+    } else if (this.boutique && this.buyed === 0 && !this.isviper) {
+      this.bottomBtn('开通文库会员')
+    } else if (this.buyed === 1) {
+      this.uploaded('down')
+    }
   }
 
   fileType (val: any) {