💥 feat(compiler):

- 登录页小程序appid自动选择企业
This commit is contained in:
fhysy 2025-02-19 17:32:38 +08:00
parent e6ee77f170
commit cf51e86ba6
1 changed files with 15 additions and 1 deletions

View File

@ -260,6 +260,7 @@
tenantEnabled:true, tenantEnabled:true,
query:{}, query:{},
isTenant: true, isTenant: true,
appid:'',
} }
}, },
computed: { computed: {
@ -268,6 +269,10 @@
}, },
}, },
onLoad(e) { onLoad(e) {
// #ifdef MP-WEIXIN
const accountInfo = uni.getAccountInfoSync();
this.appid = accountInfo.miniProgram.appId;
// #endif
if(e){ if(e){
this.query = e; this.query = e;
} }
@ -368,7 +373,16 @@
} }
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
if (data.voList != null && data.voList.length !== 0) { if(this.appid){
data.voList.forEach((item) => {
if (item.appId === this.appid) {
this.form.tenantId = item.tenantId;
logo = item.logo;
title = item.companyName;
}
});
this.isTenant = false;
}else if (data.voList != null && data.voList.length !== 0) {
this.form.tenantId = data.voList[0].tenantId; this.form.tenantId = data.voList[0].tenantId;
this.activeTenantObj = data.voList[0] ; this.activeTenantObj = data.voList[0] ;
logo = data.voList[0].logo; logo = data.voList[0].logo;