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

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
+9
View File
@@ -6,6 +6,11 @@ export interface LoginRequest {
rememberMe?: boolean
}
export interface PhoneLoginRequest {
phone: string
verificationCode: string
}
export interface RegisterRequest {
account: string
password: string
@@ -44,6 +49,10 @@ export const authApi = {
return api.post<LoginResponse>('/user/login', data)
},
phoneLogin: (data: PhoneLoginRequest) => {
return api.post<LoginResponse>('/user/phone-login', data)
},
adminLogin: (data: LoginRequest) => {
return api.post<LoginResponse>('/admin/auth/login', data)
},
+2
View File
@@ -131,6 +131,8 @@ api.interceptors.response.use(
return url?.includes('/user/login') ||
url?.includes('/user/register') ||
url?.includes('/user/refresh-token') ||
url?.includes('/user/send-verification-code') ||
url?.includes('/user/phone-login') ||
url?.includes('/shop/list/simple') ||
url?.includes('/admin/login')
}
+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)
}
}