|
@@ -34,7 +34,7 @@ function register(app, ctx) {
|
|
|
aitableEnabled: !!(ctx.config.aitable && ctx.config.aitable.enabled),
|
|
aitableEnabled: !!(ctx.config.aitable && ctx.config.aitable.enabled),
|
|
|
aitableAppKey: (ctx.config.aitable && ctx.config.aitable.appKey) || '',
|
|
aitableAppKey: (ctx.config.aitable && ctx.config.aitable.appKey) || '',
|
|
|
aitableBaseId: (ctx.config.aitable && ctx.config.aitable.baseId) || '',
|
|
aitableBaseId: (ctx.config.aitable && ctx.config.aitable.baseId) || '',
|
|
|
- aitableSheetName: (ctx.config.aitable && ctx.config.aitable.sheetName) || '经营数据',
|
|
|
|
|
|
|
+ aitableSheetName: (ctx.config.aitable && ctx.config.aitable.sheetName) || '数据表',
|
|
|
aitableSecretSet: !!(ctx.config.aitable && ctx.config.aitable.appSecret),
|
|
aitableSecretSet: !!(ctx.config.aitable && ctx.config.aitable.appSecret),
|
|
|
aitableOperatorSet: !!(ctx.config.aitable && ctx.config.aitable.operatorId),
|
|
aitableOperatorSet: !!(ctx.config.aitable && ctx.config.aitable.operatorId),
|
|
|
});
|
|
});
|
|
@@ -89,7 +89,7 @@ function register(app, ctx) {
|
|
|
else if (t) config.accessToken = t;
|
|
else if (t) config.accessToken = t;
|
|
|
}
|
|
}
|
|
|
if (body.aitableEnabled !== undefined || body.aitableAppKey !== undefined || body.aitableBaseId !== undefined || body.aitableSheetName !== undefined || body.aitableAppSecret !== undefined || body.aitableOperatorId !== undefined) {
|
|
if (body.aitableEnabled !== undefined || body.aitableAppKey !== undefined || body.aitableBaseId !== undefined || body.aitableSheetName !== undefined || body.aitableAppSecret !== undefined || body.aitableOperatorId !== undefined) {
|
|
|
- if (!config.aitable || typeof config.aitable !== 'object') config.aitable = { enabled: false, appKey: '', appSecret: '', baseId: '', sheetName: '经营数据', operatorId: '' };
|
|
|
|
|
|
|
+ if (!config.aitable || typeof config.aitable !== 'object') config.aitable = { enabled: false, appKey: '', appSecret: '', baseId: '', sheetName: '数据表', operatorId: '' };
|
|
|
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) {
|
|
if (body.aitableBaseId !== undefined) {
|
|
@@ -98,7 +98,7 @@ function register(app, ctx) {
|
|
|
const m = /i\/nodes\/([A-Za-z0-9]+)/.exec(raw) || /[?&]baseId=([A-Za-z0-9]+)/.exec(raw);
|
|
const m = /i\/nodes\/([A-Za-z0-9]+)/.exec(raw) || /[?&]baseId=([A-Za-z0-9]+)/.exec(raw);
|
|
|
config.aitable.baseId = m ? m[1] : 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();
|
|
|
if (sec === '-') config.aitable.appSecret = ''; // 约定:输入 - 清除
|
|
if (sec === '-') config.aitable.appSecret = ''; // 约定:输入 - 清除
|