33 lines
779 B
TypeScript
33 lines
779 B
TypeScript
import { request } from '@/utils/http'
|
|
import type { UserInfoDTO } from './types'
|
|
|
|
export interface UserProfileDTO {
|
|
user: UserInfoDTO
|
|
roleName?: string
|
|
}
|
|
|
|
export interface UpdateProfileCommand {
|
|
nickName?: string
|
|
phoneNumber?: string
|
|
email?: string
|
|
sex?: number
|
|
}
|
|
|
|
export interface UpdatePasswordCommand {
|
|
newPassword: string
|
|
confirmPassword: string
|
|
}
|
|
|
|
export function getProfileApi() {
|
|
return request<UserProfileDTO>({ method: 'GET', url: '/app/user/profile' })
|
|
}
|
|
|
|
export function updateProfileApi(data: UpdateProfileCommand) {
|
|
return request<void>({ method: 'PUT', url: '/app/user/profile', data })
|
|
}
|
|
|
|
export function updatePasswordApi(data: UpdatePasswordCommand) {
|
|
return request<void>({ method: 'PUT', url: '/app/user/profile/password', data })
|
|
}
|
|
|