feat: 创建企业逻辑对接

This commit is contained in:
rd
2025-09-10 17:57:42 +08:00
parent 25f74691c6
commit 32bc0c4b95
8 changed files with 90 additions and 50 deletions

View File

@ -277,18 +277,23 @@ const onTabChange = () => {
const getProfileInfo = async () => {
const { code, data } = await fetchProfileInfo();
if (code === 200) {
let enterprises = data['enterprises'];
mobileNumber.value = data['mobile'];
accounts.value = enterprises;
// 已开通
if (data.primary_enterprise?.subscribe_status === 1) {
const enterprises = data['enterprises'];
mobileNumber.value = data['mobile'];
accounts.value = enterprises;
if (enterprises.length > 0) {
enterpriseStore.setEnterpriseInfo(data.enterprises[0]);
if (enterprises.length === 1) {
handleUserLogin();
} else {
// 多个企业时候需要弹窗让用户选择企业
selectAccountModalRef.value.open();
if (enterprises.length > 0) {
enterpriseStore.setEnterpriseInfo(data.enterprises[0]);
if (enterprises.length === 1) {
handleUserLogin();
} else {
// 多个企业时候需要弹窗让用户选择企业
selectAccountModalRef.value.open();
}
}
} else {
router.push({name: 'Trial'})
}
}
};
@ -312,7 +317,6 @@ const handleSubmit = async () => {
const _fn = isCaptchaLogin.value ? fetchAuthorizationsCaptcha : postLoginPassword;
const { code, data, message: errorInfo } = await _fn(loginForm);
console.log(code, errorInfo);
if (code === 10001) {
errMsg.value = errorInfo;
return;