|
@@ -23,6 +23,10 @@ export const useUserStore = defineStore(
|
|
|
const isCompletedInfo = computed(() => {
|
|
|
return !!(+userInfo.value?.infoState)
|
|
|
})
|
|
|
+ const updateAccount = (data: any) => {
|
|
|
+ const commonStore = useCommonStore()
|
|
|
+ commonStore.pushAccount({ email: data.email, name: `${data.firstName} ${data.lastName}`, type: data.type })
|
|
|
+ }
|
|
|
|
|
|
/** 登录操作 */
|
|
|
const login = async (params: LoginRequestData) => {
|
|
@@ -36,8 +40,7 @@ export const useUserStore = defineStore(
|
|
|
type: 'success',
|
|
|
plain: true,
|
|
|
})
|
|
|
- const commonStore = useCommonStore()
|
|
|
- commonStore.pushAccount({ email: userDataInfo.email, name: `${userDataInfo.firstName} ${userDataInfo.lastName}`, type: params.type })
|
|
|
+ updateAccount(userInfo.value)
|
|
|
}
|
|
|
catch (error) {
|
|
|
return Promise.reject(error)
|
|
@@ -45,7 +48,9 @@ export const useUserStore = defineStore(
|
|
|
}
|
|
|
const updateUserInfo = (data: any) => {
|
|
|
userInfo.value = { ...userInfo.value, ...data }
|
|
|
+ updateAccount(userInfo.value)
|
|
|
}
|
|
|
+
|
|
|
/** 退出登录操作 */
|
|
|
const logout = async () => {
|
|
|
try {
|