Ver Fonte

Merge branch 'main' of http://gitlab.pubdata.cn/hlm/multi-platform-media-manage

Ethanfly há 1 dia atrás
pai
commit
cf6f1f8b6b

+ 0 - 14
client/src/components.d.ts

@@ -15,34 +15,23 @@ declare module 'vue' {
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
     ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
-    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
     ElContainer: typeof import('element-plus/es')['ElContainer']
     ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
     ElDialog: typeof import('element-plus/es')['ElDialog']
-    ElDivider: typeof import('element-plus/es')['ElDivider']
-    ElDrawer: typeof import('element-plus/es')['ElDrawer']
     ElDropdown: typeof import('element-plus/es')['ElDropdown']
     ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
     ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
     ElEmpty: typeof import('element-plus/es')['ElEmpty']
-    ElForm: typeof import('element-plus/es')['ElForm']
-    ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElInput: typeof import('element-plus/es')['ElInput']
     ElMain: typeof import('element-plus/es')['ElMain']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
-    ElOption: typeof import('element-plus/es')['ElOption']
-    ElPagination: typeof import('element-plus/es')['ElPagination']
-    ElProgress: typeof import('element-plus/es')['ElProgress']
     ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
     ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
-    ElSelect: typeof import('element-plus/es')['ElSelect']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
-    ElTable: typeof import('element-plus/es')['ElTable']
-    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     ElTabPane: typeof import('element-plus/es')['ElTabPane']
     ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
@@ -51,7 +40,4 @@ declare module 'vue' {
     RouterView: typeof import('vue-router')['RouterView']
     TaskProgressDialog: typeof import('./components/TaskProgressDialog.vue')['default']
   }
-  export interface ComponentCustomProperties {
-    vLoading: typeof import('element-plus/es')['ElLoadingDirective']
-  }
 }

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


+ 1 - 1
server/python/platforms/baijiahao.py

@@ -145,7 +145,7 @@ class BaijiahaoPublisher(BasePublisher):
                         list_url,
                         headers={
                             'accept': '*/*',
-                            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
+                            'user-agent': 'PostmanRuntime/7.51.0',
                             'cookie': cookie_str,
                             'referer': 'https://baijiahao.baidu.com/builder/rc/content',
                             'connection': 'keep-alive',

+ 18 - 0
server/src/services/HeadlessBrowserService.ts

@@ -579,6 +579,24 @@ class HeadlessBrowserService {
   async fetchAccountInfo(platform: PlatformType, cookies: CookieData[]): Promise<AccountInfo> {
     logger.info(`[fetchAccountInfo] Starting for platform: ${platform}`);
 
+    // 百家号:优先走 Python 的 /account_info(包含粉丝数、作品数),避免 Node 直连分散认证问题
+    if (platform === 'baijiahao') {
+      const pythonAvailable = await this.checkPythonServiceAvailable();
+      if (pythonAvailable) {
+        logger.info(`[Python API] Service available, fetching account_info for baijiahao`);
+        try {
+          return await this.fetchAccountInfoViaPython(platform, cookies);
+        } catch (error) {
+          logger.warn(`[Python API] Failed to fetch account_info for baijiahao, falling back to direct API:`, error);
+        }
+      } else {
+        logger.info(`[Python API] Service not available for baijiahao, falling back to direct API`);
+      }
+
+      // Python 不可用或失败时,回退到 Node 直连 API(可能仍会遇到分散认证问题)
+      return this.fetchBaijiahaoAccountInfoDirectApi(cookies);
+    }
+
     // 对于支持的平台,尝试使用 Python API 获取作品列表和账号信息
     // 包括百家号,通过 Python API 执行,逻辑与 Node 服务端保持一致
     const supportedPlatforms: PlatformType[] = ['douyin', 'xiaohongshu', 'kuaishou', 'weixin_video', 'baijiahao'];