refactor: 钉钉扫码认证设置优化

--bug=1048604 --user=王孝刚 【系统管理】钉钉扫码认证设置优化 https://www.tapd.cn/57709429/s/1622777
This commit is contained in:
wxg0103 2024-12-02 18:18:13 +08:00 committed by wxg
parent 36755672ba
commit be0b407cf1
3 changed files with 16 additions and 3 deletions

View File

@ -58,6 +58,6 @@ def run():
existing_job = scheduler.get_job(job_id='clean_chat_log')
if existing_job is not None:
existing_job.remove()
scheduler.add_job(clean_chat_log_job, 'cron', minute='*/5', id='clean_chat_log')
scheduler.add_job(clean_chat_log_job, 'cron', hour='0', minute='5', id='clean_chat_log')
finally:
lock.un_lock('clean_chat_log_job')

View File

@ -125,7 +125,12 @@ const open = async (platform: Platform) => {
currentPlatform.config.corp_id = currentPlatform.config.agent_id
delete currentPlatform.config.agent_id
}
currentPlatform.config.callback_url = defaultCallbackUrl
currentPlatform.config = {
corp_id: currentPlatform.config.corp_id,
app_key: currentPlatform.config.app_key,
app_secret: currentPlatform.config.app_secret,
callback_url: defaultCallbackUrl
}
break
case 'lark':
currentPlatform.config.callback_url = `${defaultCallbackUrl}/api/feishu`

View File

@ -131,7 +131,6 @@ function createPlatform(key: string, name: string): Platform {
const config = {
...(key === 'wecom' ? { corp_id: '', agent_id: '' } : { app_key: '' }),
...(key === 'dingtalk' ? { corp_id: '' } : {}),
app_secret: '',
callback_url: ''
}
@ -172,6 +171,15 @@ function getPlatformInfo() {
isActive: data.is_active,
config: data.config
})
if (platform.key === 'dingtalk') {
const { corp_id, app_key, app_secret } = platform.config
platform.config = {
corp_id,
app_key,
app_secret,
callback_url: platform.config.callback_url
}
}
showPassword[platform.key] = {}
showPassword[platform.key]['app_secret'] = false
}