一些问题的修复
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import api from './index'
|
||||
|
||||
export interface SendVerificationCodeRequest {
|
||||
phone: string
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
account: string
|
||||
password: string
|
||||
@@ -48,7 +52,17 @@ export interface RefreshTokenResponse {
|
||||
refreshToken: string
|
||||
}
|
||||
|
||||
export interface ResetPasswordRequest {
|
||||
phone: string
|
||||
verificationCode: string
|
||||
newPassword: string
|
||||
}
|
||||
|
||||
export const authApi = {
|
||||
sendVerificationCode: (data: SendVerificationCodeRequest) => {
|
||||
return api.post('/user/send-verification-code', data)
|
||||
},
|
||||
|
||||
login: (data: LoginRequest) => {
|
||||
return api.post<LoginResponse>('/user/login', data)
|
||||
},
|
||||
@@ -75,5 +89,9 @@ export const authApi = {
|
||||
|
||||
getUserInfo: () => {
|
||||
return api.get<UserInfo>('/user/info')
|
||||
},
|
||||
|
||||
resetPasswordByPhone: (data: ResetPasswordRequest) => {
|
||||
return api.post('/user/reset-password-by-phone', data)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user