refactor(系统设置): 平台如果有企业微信默认选中企业微信

This commit is contained in:
guoyuqi 2024-06-17 21:14:20 +08:00 committed by 刘瑞斌
parent 98cc05e01e
commit f6a672db64
1 changed files with 8 additions and 1 deletions

View File

@ -74,7 +74,7 @@
</div> </div>
</a-form> </a-form>
<div v-if="showQrCodeTab"> <div v-if="showQrCodeTab">
<tab-qr-code :tab-name="orgOptions[0].value"></tab-qr-code> <tab-qr-code :tab-name="activeName === 'WE_COM' ? 'WE_COM' : orgOptions[0].value"></tab-qr-code>
</div> </div>
<a-divider <a-divider
v-if="isShowLDAP || isShowOIDC || isShowOAUTH || (isShowQRCode && orgOptions.length > 0)" v-if="isShowLDAP || isShowOIDC || isShowOAUTH || (isShowQRCode && orgOptions.length > 0)"
@ -180,6 +180,7 @@
}); });
const showQrCodeTab = ref(false); const showQrCodeTab = ref(false);
const activeName = ref('');
function switchLoginType(type: string) { function switchLoginType(type: string) {
userInfo.value.authenticate = type; userInfo.value.authenticate = type;
@ -277,10 +278,16 @@
async function initPlatformInfo() { async function initPlatformInfo() {
try { try {
const res = await getPlatformParamUrl(); const res = await getPlatformParamUrl();
orgOptions.value = res.map((e) => ({ orgOptions.value = res.map((e) => ({
label: e.name, label: e.name,
value: e.id, value: e.id,
})); }));
res.forEach((e) => {
if (e.id === 'WE_COM') {
e.id = activeName.value;
}
});
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log(error); console.log(error);