62 lines
942 B
JavaScript
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);
|
|
}
|