Files
lanecarford_front/src/api/login.ts

40 lines
936 B
TypeScript
Raw Normal View History

2025-10-24 17:37:15 +08:00
import request from '@/utils/request'
interface LoginParamsType {
name?: string // 姓名
email: string // 邮箱
2025-10-27 11:43:07 +08:00
password?: string // 密码
2025-10-24 17:37:15 +08:00
operationType: 'REGISTER' | 'LOGIN' | 'FORGET_PWD'
verifyCode?: string // 验证码
}
2025-10-27 11:08:26 +08:00
export const precheckAndSendEmail = (data: LoginParamsType): Promise<ApiResponse> => {
2025-10-24 17:37:15 +08:00
return request({
url: '/api/auth/precheckAndSendEmail',
method: 'post',
data
})
}
2025-10-27 11:08:26 +08:00
export const fetchRegisterOrLogin = (data: LoginParamsType): Promise<LoginResponse> => {
2025-10-24 17:37:15 +08:00
return request({
url: '/api/auth/registerOrLogin',
method: 'post',
data
})
}
2025-10-27 11:08:26 +08:00
export const resetPassword = (data: LoginParamsType): Promise<ApiResponse> => {
2025-10-24 17:37:15 +08:00
return request({
url: '/api/auth/forgotPwd',
method: 'post',
data
})
}
2025-10-27 11:08:26 +08:00
export const checkLoginStatus = (): Promise<ApiResponse<LoginResponse>> => {
return request({
url: '/api/auth/checkLoginStatus',
method: 'get'
})
}