Просмотр исходного кода

fix(weixin_video): 更新登录检测规则以支持新版后台

- 在服务端扩展登录页面检测关键词,包含 login.html 和 /login
- 在客户端移除根路径误判,增加新版后台路径检测
- 统一登录状态检测规则,避免误判未登录状态
Ethanfly 2 дней назад
Родитель
Сommit
7a6496b8ad

+ 3 - 4
client/src/components/BrowserTab.vue

@@ -1789,7 +1789,6 @@ function isLoggedInByUrl(): boolean {
       /passport\.xiaohongshu/,
       /passport\.xiaohongshu/,
     ],
     ],
     weixin_video: [
     weixin_video: [
-      /channels\.weixin\.qq\.com\/?$/,      // 视频号根路径
       /channels\.weixin\.qq\.com\/login\.html/,   // 登录页
       /channels\.weixin\.qq\.com\/login\.html/,   // 登录页
       /channels\.weixin\.qq\.com\/platform\/login/, // iframe 登录页
       /channels\.weixin\.qq\.com\/platform\/login/, // iframe 登录页
     ],
     ],
@@ -1827,7 +1826,8 @@ function isLoggedInByUrl(): boolean {
       /creator\.xiaohongshu\.com\/new\//,           // /new/ 下的其他页面也算
       /creator\.xiaohongshu\.com\/new\//,           // /new/ 下的其他页面也算
     ],
     ],
     weixin_video: [
     weixin_video: [
-      /channels\.weixin\.qq\.com\/platform(?!\/login)/,        // 主要判断条件(排除 login-for-iframe 等未登录态)
+      /channels\.weixin\.qq\.com\/platform(?!\/login)/,        // 主要判断条件(排除 iframe 登录页)
+      /channels\.weixin\.qq\.com\/mp\//,                       // 新版视频号后台(mp 路径)
     ],
     ],
     bilibili: [
     bilibili: [
       /member\.bilibili\.com\/platform/,
       /member\.bilibili\.com\/platform/,
@@ -1859,7 +1859,7 @@ function isLoggedInByUrl(): boolean {
       /xiaohongshu\.com/,
       /xiaohongshu\.com/,
       /xhslink\.com/,
       /xhslink\.com/,
     ],
     ],
-    weixin_video: [],
+    weixin_video: [/channels\.weixin\.qq\.com/],
     bilibili: [/bilibili\.com/],
     bilibili: [/bilibili\.com/],
     toutiao: [/toutiao\.com/],
     toutiao: [/toutiao\.com/],
     baijiahao: [/baidu\.com/, /baijiahao\.baidu\.com/],
     baijiahao: [/baidu\.com/, /baijiahao\.baidu\.com/],
@@ -1987,7 +1987,6 @@ function isOnLoginPage(): boolean {
       /passport\.xiaohongshu/,
       /passport\.xiaohongshu/,
     ],
     ],
     weixin_video: [
     weixin_video: [
-      /channels\.weixin\.qq\.com\/?$/,      // 视频号根路径
       /channels\.weixin\.qq\.com\/login\.html/,   // 视频号登录页
       /channels\.weixin\.qq\.com\/login\.html/,   // 视频号登录页
       /channels\.weixin\.qq\.com\/platform\/login/, // 视频号 iframe 登录页
       /channels\.weixin\.qq\.com\/platform\/login/, // 视频号 iframe 登录页
     ],
     ],

BIN
server/python/platforms/__pycache__/base.cpython-313.pyc


+ 1 - 1
server/src/services/HeadlessBrowserService.ts

@@ -2296,7 +2296,7 @@ class HeadlessBrowserService {
       },
       },
       weixin_video: {
       weixin_video: {
         homeUrl: 'https://channels.weixin.qq.com/platform',
         homeUrl: 'https://channels.weixin.qq.com/platform',
-        loginIndicators: ['login', 'passport'],
+        loginIndicators: ['login.html', '/login', 'passport'],
       },
       },
       baijiahao: {
       baijiahao: {
         homeUrl: 'https://baijiahao.baidu.com/builder/rc/home',
         homeUrl: 'https://baijiahao.baidu.com/builder/rc/home',