refactor(系统设置): 扫码登陆设置优化
This commit is contained in:
parent
283e55a675
commit
bd7a135147
|
@ -5,10 +5,12 @@ import {
|
||||||
GetWeComInfoUrl,
|
GetWeComInfoUrl,
|
||||||
PostDingTalkEnableUrl,
|
PostDingTalkEnableUrl,
|
||||||
PostDingTalkSaveUrl,
|
PostDingTalkSaveUrl,
|
||||||
|
PostDingTalkValidateFalseUrl,
|
||||||
PostValidateDingTalkUrl,
|
PostValidateDingTalkUrl,
|
||||||
PostValidateWeComUrl,
|
PostValidateWeComUrl,
|
||||||
PostWeComEnableUrl,
|
PostWeComEnableUrl,
|
||||||
PostWeComSaveUrl,
|
PostWeComSaveUrl,
|
||||||
|
PostWeComValidateFalseUrl,
|
||||||
} from '@/api/requrls/setting/qrCode';
|
} from '@/api/requrls/setting/qrCode';
|
||||||
|
|
||||||
import { DingTalkInfo, EnableEditorRequest, PlatformSourceList, WeComInfo } from '@/models/setting/qrCode';
|
import { DingTalkInfo, EnableEditorRequest, PlatformSourceList, WeComInfo } from '@/models/setting/qrCode';
|
||||||
|
@ -57,3 +59,13 @@ export function enableDingTalk(data: EnableEditorRequest) {
|
||||||
export function getPlatformSourceList() {
|
export function getPlatformSourceList() {
|
||||||
return MSR.get<PlatformSourceList>({ url: GetPlatformInfoUrl });
|
return MSR.get<PlatformSourceList>({ url: GetPlatformInfoUrl });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开启企业微信登陆
|
||||||
|
export function closeValidateWeCom() {
|
||||||
|
return MSR.post({ url: PostWeComValidateFalseUrl });
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开启钉钉登陆
|
||||||
|
export function closeValidateDingTalk() {
|
||||||
|
return MSR.post({ url: PostDingTalkValidateFalseUrl });
|
||||||
|
}
|
||||||
|
|
|
@ -7,3 +7,5 @@ export const GetDingTalkInfoUrl = '/ding_talk/info/with_detail';
|
||||||
export const PostDingTalkSaveUrl = '/ding_talk/save';
|
export const PostDingTalkSaveUrl = '/ding_talk/save';
|
||||||
export const PostDingTalkEnableUrl = '/ding_talk/enable';
|
export const PostDingTalkEnableUrl = '/ding_talk/enable';
|
||||||
export const GetPlatformInfoUrl = '/setting/get/platform/info';
|
export const GetPlatformInfoUrl = '/setting/get/platform/info';
|
||||||
|
export const PostWeComValidateFalseUrl = '/we_com/change/validate';
|
||||||
|
export const PostDingTalkValidateFalseUrl = '/ding_talk/change/validate';
|
||||||
|
|
|
@ -149,7 +149,7 @@
|
||||||
try {
|
try {
|
||||||
await validateDingTalkConfig(dingTalkForm.value);
|
await validateDingTalkConfig(dingTalkForm.value);
|
||||||
dingTalkForm.value.valid = true;
|
dingTalkForm.value.valid = true;
|
||||||
Message.success(t('organization.service.testLinkStatusTip'));
|
Message.success(t('common.saveSuccess'));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -116,6 +116,8 @@
|
||||||
import WeComModal from '@/views/setting/system/config/components/weComModal.vue';
|
import WeComModal from '@/views/setting/system/config/components/weComModal.vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
closeValidateDingTalk,
|
||||||
|
closeValidateWeCom,
|
||||||
enableDingTalk,
|
enableDingTalk,
|
||||||
enableWeCom,
|
enableWeCom,
|
||||||
getPlatformSourceList,
|
getPlatformSourceList,
|
||||||
|
@ -224,10 +226,15 @@
|
||||||
await validateDingTalkConfig(dingTalkInfo.value);
|
await validateDingTalkConfig(dingTalkInfo.value);
|
||||||
}
|
}
|
||||||
Message.success(t('organization.service.testLinkStatusTip'));
|
Message.success(t('organization.service.testLinkStatusTip'));
|
||||||
loadList();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (key === 'WE_COM') {
|
||||||
|
await closeValidateWeCom();
|
||||||
|
} else if (key === 'DING_TALK') {
|
||||||
|
await closeValidateDingTalk();
|
||||||
|
}
|
||||||
console.log(error);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
loadList();
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -162,7 +162,7 @@
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
await saveWeComConfig(weComForm.value);
|
await saveWeComConfig(weComForm.value);
|
||||||
Message.success(t('organization.service.testLinkStatusTip'));
|
Message.success(t('common.saveSuccess'));
|
||||||
emits('success');
|
emits('success');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
Loading…
Reference in New Issue