From 2ee8ddb1ecac7df4198e54e08ec7f22daf4b07c0 Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期五, 03 一月 2025 16:57:38 +0800
Subject: [PATCH] 111

---
 pages/index/resourceCover.js |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/pages/index/resourceCover.js b/pages/index/resourceCover.js
index 683ad99..de4f902 100644
--- a/pages/index/resourceCover.js
+++ b/pages/index/resourceCover.js
@@ -1,5 +1,8 @@
 // pages/index/resourceCover.js
 const app = getApp()
+import {
+  loginInfo
+} from '../../assets/js/login';
 Page({
 
   /**
@@ -20,9 +23,22 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad(options) {
-    if (options.scene) {
-      this.getBookInfo(options.scene)
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        // 濡傛灉涓嶆槸绗竴娆$櫥褰曪紝浼氭墽琛屽洖璋�
+        if (data) {
+          if (options.scene) {
+            this.getBookInfo(options.scene)
+          }
+        }
+      })
+    } else {
+      if (options.scene) {
+        this.getBookInfo(options.scene)
+      }
     }
+
   },
 
   /**
@@ -41,8 +57,8 @@
 
   getBookInfo(refcode) {
     const obj = {
-      storeInfo: app.config.jslx,
-      path: app.config.jslx,
+      storeInfo: app.config.goodsStore,
+      path: app.config.goodsStore,
       queryType: 'ProductCmsItem',
       SysType: "CmsItem",
       RefCode: refcode,
@@ -92,7 +108,7 @@
         formPath: book.learnSelectType ? 'jsek_cloudLearning' : ''
       })
       wx.redirectTo({
-        url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&activeId=${book.id}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&storeInfo=${book.storeInfo}&formPath=${this.data.formPath}`,
+        url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&activeId=${book.id}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&formPath=${this.data.formPath}`,
       });
 
       if (book.selectType == "pdf" || book.selectType == 'document') {

--
Gitblit v1.9.1