Fix isFeishu undefined error and ignore .trae/

- Define isFeishu = isFeishuWiki || isFeishuDocx (was referenced but
  never declared, causing ReferenceError on Feishu URLs)
- Add mkdirSync import, drop unused basename
- Add .trae/ to .gitignore (IDE-local skill drafts, not for publish)
This commit is contained in:
beyondx123
2026-07-05 20:36:45 +08:00
parent 70a1103915
commit 67ea1ddba2
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -13,8 +13,8 @@
*/
import { chromium } from 'playwright';
import CryptoJS from 'crypto-js';
import { writeFileSync, readFileSync, existsSync } from 'fs';
import { resolve, basename, dirname } from 'path';
import { writeFileSync, readFileSync, existsSync, mkdirSync } from 'fs';
import { resolve, dirname } from 'path';
import { execSync } from 'child_process';
import { fileURLToPath } from 'url';
@@ -55,6 +55,7 @@ const COOKIE_FILE = resolve('cookies.json');
const isFeishuWiki = /feishu\.cn\/wiki\//.test(TARGET_URL);
const isFeishuDocx = /feishu\.cn\/docx\//.test(TARGET_URL);
const isYitang = TARGET_URL.includes('yitang.top/fs-doc/');
const isFeishu = isFeishuWiki || isFeishuDocx;
if (!isFeishuWiki && !isFeishuDocx && !isYitang) {
console.error('❌ URL 格式不正确,支持 yitang.top/fs-doc/<acl>/<docId> 或 *.feishu.cn/wiki/<token>');