fix:修改个人信息界面以及接口
This commit is contained in:
@@ -106,7 +106,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
//查询用户信息
|
||||
async function refreshUserInfo() {
|
||||
const { data: info, error } = await doGetUserInfo();
|
||||
if (!error) {
|
||||
@@ -115,6 +115,16 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**修改用户信息**/
|
||||
async function updateUserProfile(info: Api.Auth.ChangeInfoBody) {
|
||||
try {
|
||||
await doChangeUserInfo(info);
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error('Failed to update user profile:', error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户信息是否已存在
|
||||
@@ -141,7 +151,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
endLoading();
|
||||
return !error;
|
||||
}
|
||||
|
||||
//二维码
|
||||
async function captcha(email: string) {
|
||||
if (!email) {
|
||||
return null;
|
||||
@@ -161,6 +171,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||
refreshUserInfo,
|
||||
register,
|
||||
captcha,
|
||||
checkUserRepeat
|
||||
checkUserRepeat,
|
||||
updateUserProfile
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user