注册集成手机号登录,修改密码,修改手机号

This commit is contained in:
xiaowang
2026-03-03 14:39:02 +08:00
parent 2c505deaf9
commit b301e37468
29 changed files with 1405 additions and 44 deletions
+27
View File
@@ -48,6 +48,21 @@ export interface UpdateUserRequest {
shopId?: number
}
export interface UpdatePasswordRequest {
password: string
}
export interface BindPhoneRequest {
phone: string
verificationCode: string
}
export interface UpdatePhoneRequest {
oldPhone: string
newPhone: string
verificationCode: string
}
export const userApi = {
getUserInfo: () => {
return api.get<UserVO>('/user/info')
@@ -55,10 +70,22 @@ export const userApi = {
updateUserInfo: (data: UpdateUserInfoRequest) => {
return api.put('/user/info', data)
},
updatePassword: (data: UpdatePasswordRequest) => {
return api.put('/user/password', data)
},
bindPhone: (data: BindPhoneRequest) => {
return api.post('/user/bind-phone', data)
},
updatePhone: (data: UpdatePhoneRequest) => {
return api.put('/user/phone', data)
},
getUserByAccount: (account: string) => {
return api.get<UserVO>(`/user/get/account/${account}`)
},
listUsersByType: (type: number) => {
return api.get<UserVO[]>(`/user/list/type/${type}`)
},
sendVerificationCode: (data: { phone: string }) => {
return api.post('/user/send-verification-code', data)
}
}