refactor(user): 重构用户信息获

This commit is contained in:
rd
2025-09-19 09:40:06 +08:00
parent 55b4ed1e83
commit 192a125d01
6 changed files with 21 additions and 12 deletions

View File

@ -92,7 +92,7 @@ import PuzzleVerification from '../PuzzleVerification.vue';
import SelectAccountModal from '../select-account-modal/index.vue';
import { postClearRateLimiter } from '@/api/all/common';
import {
fetchProfileInfo,
fetchUserInfo,
postForgetPassword,
postForgetPasswordCaptcha,
postRegister,
@ -295,8 +295,9 @@ const handleVerificationSubmit = async () => {
// 获取用户信息
const getProfileInfo = async () => {
const { code, data } = await fetchProfileInfo();
const { code, data } = await fetchUserInfo();
if (code === 200) {
const enterprises = data['enterprises'];
mobileNumber.value = data['mobile'];
accounts.value = enterprises;
@ -311,6 +312,7 @@ const getProfileInfo = async () => {
selectAccountModalRef.value.open();
}
} else {
userStore.setUserInfo(data);
router.push({ name: 'Trial' });
}
}
@ -348,7 +350,7 @@ const handleSubmit = async () => {
}, 1500);
return;
}
;
userStore.setToken(data.access_token);