Files
hzdyjs/mobile/api/auth.js
T
2025-06-26 18:30:03 +08:00

62 lines
942 B
JavaScript

/**
* 认证相关API
*/
import { post, get } from '@/utils/request.js';
/**
* 用户登录
*/
export function loginApi(data) {
return post('/auth/login', data);
}
/**
* 用户退出
*/
export function logoutApi() {
return post('/auth/logout');
}
/**
* 获取用户信息
*/
export function getUserInfoApi() {
return get('/auth/userinfo');
}
/**
* 刷新Token
*/
export function refreshTokenApi(refreshToken) {
return post('/auth/refresh', { refreshToken });
}
/**
* 修改密码
*/
export function changePasswordApi(data) {
return post('/auth/change-password', data);
}
/**
* 重置密码
*/
export function resetPasswordApi(data) {
return post('/auth/reset-password', data);
}
/**
* 发送验证码
*/
export function sendCodeApi(data) {
return post('/auth/send-code', data);
}
/**
* 绑定手机号
*/
export function bindPhoneApi(data) {
return post('/auth/bind-phone', data);
}