From c098f1e3a3e052aa3d65584aae6dc003a70d75ad Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期二, 16 十二月 2025 00:09:14 +0800
Subject: [PATCH] feat: 停止轮询 uncount

---
 app/utils/wechat.js |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/app/utils/wechat.js b/app/utils/wechat.js
index 3c05e14..32802db 100644
--- a/app/utils/wechat.js
+++ b/app/utils/wechat.js
@@ -18,8 +18,18 @@
       resolve(isWxWork);
     } catch (e) {
       console.error('鑾峰彇绯荤粺淇℃伅澶辫触:', e);
-      // fallback妫�娴�
-      resolve(false);
+      // fallback妫�娴嬶細灏濊瘯浣跨敤wx.qy瀵硅薄鍒ゆ柇
+      try {
+        if (typeof wx !== 'undefined' && wx.qy) {
+          console.log('閫氳繃wx.qy瀵硅薄妫�娴嬪埌浼佷笟寰俊鐜');
+          resolve(true);
+        } else {
+          resolve(false);
+        }
+      } catch (e2) {
+        console.error('fallback妫�娴嬩篃澶辫触:', e2);
+        resolve(false);
+      }
     }
     // #endif
     
@@ -87,9 +97,25 @@
 export function redirectToQyLogin(options, tab) {
   try {
     let url = '/pages/qylogin';
-    if (options && options.query) {
+    // 淇濆瓨鐩爣URL鐢ㄤ簬鐧诲綍鍚庤烦杞�
+    if (options && options.path && options.path !== 'pages/qylogin') {
+      // 鏋勯�犲畬鏁寸殑璺緞鍜屾煡璇㈠弬鏁�
+      let fullPath = '/' + options.path;
+      if (options.query) {
+        const queryString = Object.keys(options.query).map(key => 
+          `${key}=${encodeURIComponent(options.query[key])}`).join('&');
+        if (queryString) {
+          fullPath += '?' + queryString;
+        }
+      }
+      
+      // 娣诲姞redirect鍙傛暟
+      const separator = fullPath.includes('?') ? '&' : '?';
+      url += `${separator}redirect=${encodeURIComponent(fullPath)}`;
+    } else if (options && options.query) {
       url = buildUrlWithParams(url, options.query);
     }
+    
     console.log('璺宠浆鍒颁紒涓氬井淇$櫥褰曢〉闈�:', url);
     tab.reLaunch(url);
   } catch (e) {

--
Gitblit v1.9.1