167 lines
2.6 KiB
TypeScript
167 lines
2.6 KiB
TypeScript
import { http } from '@/utils/http/axios';
|
|
|
|
export interface BasicResponseModel<T = any> {
|
|
code: number;
|
|
msg: string;
|
|
data: T;
|
|
}
|
|
|
|
export interface BasicPageParams {
|
|
pageNo: number;
|
|
pageSize: number;
|
|
total: number;
|
|
}
|
|
|
|
/**
|
|
* @description: 获取用户信息
|
|
*/
|
|
export function getUserInfo() {
|
|
return http.request({
|
|
url: '/index/getUser',
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description: 用户登录
|
|
*/
|
|
export function login(params) {
|
|
return http.request<BasicResponseModel>(
|
|
{
|
|
url: '/login',
|
|
method: 'POST',
|
|
params,
|
|
},
|
|
{
|
|
isTransformResponse: false,
|
|
},
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @description: 用户登录
|
|
*/
|
|
export function getInfoCaptcha() {
|
|
return http.request(
|
|
{
|
|
url: '/captcha',
|
|
method: 'GET'
|
|
},
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @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,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description: 获取用户列表
|
|
*/
|
|
export function getUserList(params) {
|
|
return http.request({
|
|
url: '/user/page',
|
|
method: 'get',
|
|
params,
|
|
});
|
|
}
|
|
/**
|
|
* @description: 根据ID获取详情
|
|
*/
|
|
export function getUserDetail(userId) {
|
|
return http.request({
|
|
url: '/user/detail/'+userId,
|
|
method: 'get',
|
|
});
|
|
}
|
|
/**
|
|
* @description: 添加用户
|
|
*/
|
|
export function userAdd(data:any) {
|
|
return http.request({
|
|
url: '/user/add',
|
|
method: 'POST',
|
|
data,
|
|
});
|
|
}
|
|
/**
|
|
* @description: 更新用户
|
|
*/
|
|
export function userUpdate(data:any) {
|
|
return http.request({
|
|
url: '/user/update',
|
|
method: 'PUT',
|
|
data
|
|
});
|
|
}
|
|
/**
|
|
* @description: 重置密码
|
|
*/
|
|
export function resetPwd(data:any) {
|
|
return http.request({
|
|
url: '/user/resetPwd',
|
|
method: 'PUT',
|
|
data
|
|
});
|
|
}
|
|
/**
|
|
* @description: 删除用户
|
|
*/
|
|
export function userDelete(userId) {
|
|
return http.request({
|
|
url: '/user/delete/'+userId,
|
|
method: 'DELETE',
|
|
});
|
|
}
|
|
/**
|
|
* @description: 批量删除用户
|
|
*/
|
|
export function userBatchDelete(data:any) {
|
|
return http.request({
|
|
url: '/user/batchDelete',
|
|
method: 'DELETE',
|
|
data
|
|
});
|
|
}
|
|
/**
|
|
* @description: 导出用户
|
|
*/
|
|
export function userExport() {
|
|
return http.request({
|
|
url: '/user/export',
|
|
method: 'GET'
|
|
},{
|
|
isTransformResponse: false,
|
|
});
|
|
}
|
|
/**
|
|
* @description: 城市列表
|
|
*/
|
|
export function getCityByList(pid:any) {
|
|
return http.request({
|
|
url: '/city/getCityList/'+pid,
|
|
method: 'get',
|
|
});
|
|
} |