登录注册完成
This commit is contained in:
parent
3f504e4c0a
commit
b6718315db
|
@ -53,9 +53,12 @@ import type { ApiResponse, PageResult } from './common/types'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface LoginParams {
|
export interface LoginParams {
|
||||||
phone: string
|
activeTab: string
|
||||||
|
username: string
|
||||||
password: string
|
password: string
|
||||||
verifyCode?: string
|
phone: string
|
||||||
|
email: string
|
||||||
|
code: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RegisterParams {
|
export interface RegisterParams {
|
||||||
|
@ -101,27 +104,24 @@ export interface UserQueryParams {
|
||||||
// 用户API接口
|
// 用户API接口
|
||||||
export const userApi = {
|
export const userApi = {
|
||||||
|
|
||||||
|
//注册
|
||||||
register(data: RegisterParams) {
|
register(data: RegisterParams) {
|
||||||
return request.post<ApiResponse>('/user/register', data)
|
return request.post<ApiResponse>('/user/register', data)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 手机号密码登录
|
// 登录
|
||||||
login(data: LoginParams) {
|
login(data: LoginParams) {
|
||||||
return request.post<ApiResponse<{ token: string }>>('/auth/login', data)
|
return request.post<ApiResponse<{ token: string }>>('/user/login', data)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 发送验证码
|
// 发送验证码
|
||||||
sendVerifyEmailCode(email: string) {
|
sendVerifyEmailCode(email: string) {
|
||||||
return request.post<ApiResponse>('/user/getEmailCode', { email })
|
return request.post<ApiResponse>('/user/getEmailCode', { email })
|
||||||
},
|
},
|
||||||
// 发送验证码
|
// 发送验证码
|
||||||
sendVerifyPhoneCode(phone: string) {
|
sendVerifyPhoneCode(phone: string) {
|
||||||
return request.post<ApiResponse>('/user/getphoneCode', { phone })
|
return request.post<ApiResponse>('/user/getPhoneCode', { phone })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取当前登录用户信息
|
// 获取当前登录用户信息
|
||||||
|
|
Loading…
Reference in New Issue