refactor(user): 重构用户信息获
This commit is contained in:
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user