🔄 卡若AI 同步 2026-03-05 05:47 | 更新:Cursor规则、水桥平台对接、运营中枢工作台 | 排除 >20MB: 11 个

This commit is contained in:
2026-03-05 05:47:21 +08:00
parent c368398e1a
commit 250c6b64a1
6 changed files with 24 additions and 3 deletions

View File

@@ -22,6 +22,14 @@ updated: "2026-03-02"
## 一键使用(推荐)
**写今日日志(默认)**:一律**直接执行**,不询问用户;三件事 + 前面未完成项:
```bash
python3 /Users/karuo/Documents/个人/卡若AI/02_卡人/水桥_平台对接/飞书管理/脚本/write_today_three_focus.py
```
**通用/历史日期**
```bash
python3 /Users/karuo/Documents/个人/卡若AI/02_卡人/水桥_平台对接/飞书管理/脚本/auto_log.py
```

View File

@@ -241,12 +241,15 @@ def parse_month_from_date_str(date_str):
def resolve_wiki_token_for_date(date_str, explicit_wiki_token=None):
"""根据日期路由文档token允许显式覆盖"""
"""根据日期路由文档token允许显式覆盖;当月 token 为空时返回 None"""
if explicit_wiki_token:
return explicit_wiki_token
month = parse_month_from_date_str(date_str)
if month and month in CONFIG.get('MONTH_WIKI_TOKENS', {}):
return CONFIG['MONTH_WIKI_TOKENS'][month]
tok = CONFIG['MONTH_WIKI_TOKENS'][month]
if tok and str(tok).strip():
return tok
return None # 当月未配置 token如 3 月需 FEISHU_MARCH_WIKI_TOKEN
return CONFIG['WIKI_TOKEN']
def _find_date_section_block_ids(blocks, date_str, doc_id):
@@ -287,7 +290,11 @@ def write_log(token, date_str=None, tasks=None, wiki_token=None, overwrite=False
if not date_str or not tasks:
date_str, tasks = get_today_tasks()
target_wiki_token = resolve_wiki_token_for_date(date_str, wiki_token)
if not target_wiki_token:
month = parse_month_from_date_str(date_str)
print(f"❌ 未配置当月文档 token{month or '?'} 月请设置 FEISHU_MARCH_WIKI_TOKEN 或对应环境变量)")
return False
# 获取文档ID
r = requests.get(f"https://open.feishu.cn/open-apis/wiki/v2/spaces/get_node?token={target_wiki_token}",
headers=headers, timeout=30)

View File

@@ -99,6 +99,9 @@ def main():
print(f"{date_str} 飞书日志已写入(三件事 + 前面未完成)")
sys.exit(0)
print("❌ 写入失败")
ref_path = SCRIPT_DIR.parent / "参考资料" / f"{date_str}_飞书日志正文_三件事与未完成.md"
if ref_path.exists():
print(f"💡 可复制 {ref_path} 内容到飞书 3 月文档手动粘贴")
sys.exit(1)