添加收藏茶室接口和完善茶室详情
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import type { ICaptcha, IUpdateInfo, IUpdatePassword, IUserInfoVo, IUserLogin } from './types/login'
|
||||
import { http } from '@/http/http'
|
||||
import { http } from '@/http/alova'
|
||||
|
||||
|
||||
/**
|
||||
* 登录表单
|
||||
@ -11,12 +12,21 @@ export interface ILoginForm {
|
||||
uuid: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机密码登录
|
||||
*/
|
||||
export interface IMobileLoginForm {
|
||||
account: string
|
||||
terminal: number
|
||||
scene: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
* @returns ICaptcha 验证码
|
||||
*/
|
||||
export function getCode() {
|
||||
return http.get<ICaptcha>('/user/getCode')
|
||||
return http.Get<ICaptcha>('/user/getCode')
|
||||
}
|
||||
|
||||
/**
|
||||
@ -24,35 +34,48 @@ export function getCode() {
|
||||
* @param loginForm 登录表单
|
||||
*/
|
||||
export function login(loginForm: ILoginForm) {
|
||||
return http.post<IUserLogin>('/user/login', loginForm)
|
||||
return http.Post<IUserLogin>('/api/user/login', loginForm)
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* @param loginForm 登录表单
|
||||
*/
|
||||
export function mobileLogin(loginForm: IMobileLoginForm) {
|
||||
return http.Post<IUserLogin>('/api/login/account',
|
||||
loginForm,
|
||||
{
|
||||
meta: { ignoreAuth: true } // 忽略认证
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
export function getUserInfo() {
|
||||
return http.get<IUserInfoVo>('/user/info')
|
||||
return http.Get<IUserInfoVo>('/api/user/info')
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
export function logout() {
|
||||
return http.get<void>('/user/logout')
|
||||
return http.Get<void>('/user/logout')
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
*/
|
||||
export function updateInfo(data: IUpdateInfo) {
|
||||
return http.post('/user/updateInfo', data)
|
||||
return http.Get('/user/updateInfo', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户密码
|
||||
*/
|
||||
export function updateUserPassword(data: IUpdatePassword) {
|
||||
return http.post('/user/updatePassword', data)
|
||||
return http.Get('/user/updatePassword', data)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -79,5 +102,10 @@ export function getWxCode() {
|
||||
* @returns Promise 包含登录结果
|
||||
*/
|
||||
export function wxLogin(data: { code: string }) {
|
||||
return http.post<IUserLogin>('/user/wxLogin', data)
|
||||
return http.Post<IUserLogin>('/api/login/mnpLogin',
|
||||
data,
|
||||
{
|
||||
meta: { ignoreAuth: true } // 忽略认证
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user