mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-08 23:42:27 +08:00
67 lines
1.0 KiB
TypeScript
67 lines
1.0 KiB
TypeScript
import { http } from '@/utils/http/axios';
|
|
|
|
export interface BasicResponseModel<T = any> {
|
|
code: number;
|
|
message: string;
|
|
result: T;
|
|
}
|
|
|
|
export interface BasicPageParams {
|
|
pageNumber: number;
|
|
pageSize: number;
|
|
total: number;
|
|
}
|
|
|
|
/**
|
|
* @description: 获取用户信息
|
|
*/
|
|
export function getUserInfo() {
|
|
return http.request({
|
|
url: '/admin_info',
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description: 用户登录
|
|
*/
|
|
export function login(params) {
|
|
return http.request<BasicResponseModel>(
|
|
{
|
|
url: '/login',
|
|
method: 'POST',
|
|
params,
|
|
},
|
|
{
|
|
isTransformResponse: false,
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @description: 用户修改密码
|
|
*/
|
|
export function changePassword(params, uid) {
|
|
return http.request(
|
|
{
|
|
url: `/user/u${uid}/changepw`,
|
|
method: 'POST',
|
|
params,
|
|
},
|
|
{
|
|
isTransformResponse: false,
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @description: 用户登出
|
|
*/
|
|
export function logout(params) {
|
|
return http.request({
|
|
url: '/login/logout',
|
|
method: 'POST',
|
|
params,
|
|
});
|
|
}
|