feat: fix#15077

This commit is contained in:
XieYongHong 2023-06-07 17:46:43 +08:00
parent 7a8340d3e8
commit d50c028de6
1 changed files with 7 additions and 6 deletions

View File

@ -243,12 +243,13 @@ const checkNoticeDelete = async () => {
const itemType = variableDefinitionsMap.get(variableKey) const itemType = variableDefinitionsMap.get(variableKey)
let hasUser = false let hasUser = false
console.log(itemType, notifyType)
if (itemType === 'user') { // if (itemType === 'user') { //
let resp = undefined; let resp = undefined;
if (notifyType === 'dingTalk') { if (['dingTalk', 'weixin'].includes(notifyType)) {
resp = await noticeConfig.queryDingTalkUsers(item!.notifierId); resp = notifyType === 'dingTalk' ? await noticeConfig.queryDingTalkUsers(item!.notifierId) : await noticeConfig.queryWechatUsers(item!.notifierId);
} else { } else {
resp = await noticeConfig.queryWechatUsers(item!.notifierId); hasUser = true
} }
if (resp && resp.success) { if (resp && resp.success) {
@ -267,10 +268,10 @@ const checkNoticeDelete = async () => {
if (itemType === 'org') { // if (itemType === 'org') { //
let resp = undefined; let resp = undefined;
if (notifyType === 'dingTalk') { if (['dingTalk', 'weixin'].includes(notifyType)) {
resp = await noticeConfig.dingTalkDept(item!.notifierId) resp = notifyType === 'dingTalk' ? await noticeConfig.dingTalkDept(item!.notifierId) : await noticeConfig.weChatDept(item!.notifierId)
} else { } else {
resp = await noticeConfig.weChatDept(item!.notifierId) hasUser = true
} }
if (resp && resp.success) { if (resp && resp.success) {