1
This commit is contained in:
@@ -13,12 +13,13 @@ import type {
|
||||
AuthPhoneChangeResponse,
|
||||
AuthPhoneLoginResponse,
|
||||
AuthPhoneSendCodeResponse,
|
||||
AuthProfileUpdateRequest,
|
||||
AuthProfileUpdateResponse,
|
||||
AuthRevokeSessionResponse,
|
||||
AuthRiskBlocksResponse,
|
||||
AuthRiskBlockSummary,
|
||||
AuthSessionsResponse,
|
||||
AuthSessionSummary,
|
||||
AuthUser,
|
||||
AuthWechatBindPhoneResponse,
|
||||
AuthWechatStartResponse,
|
||||
LogoutResponse,
|
||||
@@ -261,6 +262,23 @@ export async function changePassword(
|
||||
return response.user;
|
||||
}
|
||||
|
||||
export async function updateAuthProfile(payload: AuthProfileUpdateRequest) {
|
||||
const response = await requestJson<AuthProfileUpdateResponse>(
|
||||
'/api/profile/me',
|
||||
{
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
displayName: payload.displayName?.trim() || undefined,
|
||||
avatarDataUrl: payload.avatarDataUrl?.trim() || undefined,
|
||||
}),
|
||||
},
|
||||
'更新资料失败',
|
||||
);
|
||||
|
||||
return response.user;
|
||||
}
|
||||
|
||||
export async function resetPassword(
|
||||
phone: string,
|
||||
code: string,
|
||||
|
||||
Reference in New Issue
Block a user