From 04c7b0163caeae4ab1c5da62e301fa993101cfad Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 31 三月 2025 10:40:45 +0800
Subject: [PATCH] bug修改

---
 packageDomain/pages/sampleBookList/index.js |   44 +++++++++++++++++++-------------------------
 1 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js
index 66082cd..2db2783 100644
--- a/packageDomain/pages/sampleBookList/index.js
+++ b/packageDomain/pages/sampleBookList/index.js
@@ -142,21 +142,7 @@
 
     // 妫�鏌ョ櫥褰曠姸鎬�
     const token = wx.getStorageSync(app.config.tokenKey)
-    if (!token) {
-      loginInfo(app, (data) => {
-        if (data) {
-          that.setData({
-            userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
-          })
-          that.getAlreadyPBookList()
-          that.getAlreadyEBookList()
-          // 鑾峰彇鐢宠娆℃暟
-          that.getSelectPaperBookCount()
-          that.getSelectBookCount()
-
-        }
-      })
-    } else {
+    if (token) {
       that.setData({
         userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
       })
@@ -181,16 +167,24 @@
    */
   onShow() {
     let that = this;
-    // that.setData({
-    //   page: 1,
-    //   paperBookList: [],
-    //   electronicBookList: []
-    // })
-    that.getAlreadyPBookList()
-    that.getAlreadyEBookList()
-    // 鑾峰彇鐢宠娆℃暟
-    that.getSelectPaperBookCount()
-    that.getSelectBookCount()
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {
+          that.setData({
+            userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
+          })
+          that.getAlreadyPBookList()
+          that.getAlreadyEBookList()
+          that.getSelectPaperBookCount()
+          that.getSelectBookCount()
+        } else {
+          wx.switchTab({
+            url: '/pages/home/home',
+          })
+        }
+      })
+    }
     if (wx.getStorageSync("paperBookList") || wx.getStorageSync("electronicBookList")) {
       if (wx.getStorageSync("paperBookList")) {
         that.setData({

--
Gitblit v1.9.1