feat: api创建

This commit is contained in:
zhangyh
2025-10-24 17:37:15 +08:00
parent 21384516ce
commit 5fe30c82c8
14 changed files with 197 additions and 86 deletions

33
src/api/login.ts Normal file
View File

@@ -0,0 +1,33 @@
import request from '@/utils/request'
interface LoginParamsType {
name?: string // 姓名
email: string // 邮箱
password: string // 密码
operationType: 'REGISTER' | 'LOGIN' | 'FORGET_PWD'
verifyCode?: string // 验证码
}
export const precheckAndSendEmail = (data: LoginParamsType) => {
return request({
url: '/api/auth/precheckAndSendEmail',
method: 'post',
data
})
}
export const fetchLogin = (data: LoginParamsType) => {
return request({
url: '/api/auth/registerOrLogin',
method: 'post',
data
})
}
export const resetPassword = (data: LoginParamsType) => {
return request({
url: '/api/auth/forgotPwd',
method: 'post',
data
})
}