forked from wangziqi/gongxue-base
fix(integration): simplify manual DingTalk sync setup
This commit is contained in:
@@ -125,7 +125,12 @@ export class IntegrationConfigService {
|
||||
config: DingTalkThirdConfig | WeComThirdConfig,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
const token = await this.getTokenForTest(type, config as unknown as Record<string, unknown>);
|
||||
const finalConfig = { ...config } as Record<string, unknown>;
|
||||
if (!finalConfig.appSecret) {
|
||||
const savedConfig = await this.getRawConfig(type);
|
||||
if (savedConfig?.appSecret) finalConfig.appSecret = savedConfig.appSecret;
|
||||
}
|
||||
const token = await this.getTokenForTest(type, finalConfig);
|
||||
return !!token;
|
||||
} catch (e) {
|
||||
this.logger.error(`连接测试失败: ${(e as Error).message}`);
|
||||
|
||||
Reference in New Issue
Block a user