|
@@ -91,7 +91,12 @@ function register(app, ctx) {
|
|
|
if (!config.aitable || typeof config.aitable !== 'object') config.aitable = { enabled: false, appKey: '', appSecret: '', baseId: '', sheetName: '经营数据' };
|
|
if (!config.aitable || typeof config.aitable !== 'object') config.aitable = { enabled: false, appKey: '', appSecret: '', baseId: '', sheetName: '经营数据' };
|
|
|
if (body.aitableEnabled !== undefined) config.aitable.enabled = !!body.aitableEnabled;
|
|
if (body.aitableEnabled !== undefined) config.aitable.enabled = !!body.aitableEnabled;
|
|
|
if (body.aitableAppKey !== undefined) config.aitable.appKey = String(body.aitableAppKey).trim();
|
|
if (body.aitableAppKey !== undefined) config.aitable.appKey = String(body.aitableAppKey).trim();
|
|
|
- if (body.aitableBaseId !== undefined) config.aitable.baseId = String(body.aitableBaseId).trim();
|
|
|
|
|
|
|
+ if (body.aitableBaseId !== undefined) {
|
|
|
|
|
+ // 支持直接粘贴 AI 表格分享链接:自动提取 /i/nodes/<ID> 里的节点 ID 作为 Base ID
|
|
|
|
|
+ const raw = String(body.aitableBaseId).trim();
|
|
|
|
|
+ const m = /i\/nodes\/([A-Za-z0-9]+)/.exec(raw) || /[?&]baseId=([A-Za-z0-9]+)/.exec(raw);
|
|
|
|
|
+ config.aitable.baseId = m ? m[1] : raw;
|
|
|
|
|
+ }
|
|
|
if (body.aitableSheetName !== undefined) config.aitable.sheetName = String(body.aitableSheetName).trim() || '经营数据';
|
|
if (body.aitableSheetName !== undefined) config.aitable.sheetName = String(body.aitableSheetName).trim() || '经营数据';
|
|
|
if (body.aitableAppSecret !== undefined) {
|
|
if (body.aitableAppSecret !== undefined) {
|
|
|
const sec = String(body.aitableAppSecret).trim();
|
|
const sec = String(body.aitableAppSecret).trim();
|