feat: app功能基本实现
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user