mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-22 14:57:14 +08:00
新增:新增系统管理/用户管理(列表、查看详情、新增、修改、删除、导出)
This commit is contained in:
@@ -2,6 +2,7 @@ import axios from 'axios';
|
||||
import qs from 'query-string';
|
||||
import { DeptParam } from '@/api/system/dept';
|
||||
import { MenuParam } from '@/api/system/menu';
|
||||
import { RoleParam } from '@/api/system/role';
|
||||
import { TreeNodeData } from '@arco-design/web-vue';
|
||||
|
||||
export function listDeptTree(params: DeptParam) {
|
||||
@@ -21,3 +22,12 @@ export function listMenuTree(params: MenuParam) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function listRoleTree(params: RoleParam) {
|
||||
return axios.get<TreeNodeData[]>('/common/tree/role', {
|
||||
params,
|
||||
paramsSerializer: (obj) => {
|
||||
return qs.stringify(obj);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ export function getDept(id: number) {
|
||||
return axios.get<DeptRecord>(`${BASE_URL}/${id}`);
|
||||
}
|
||||
|
||||
export function createDept(req: DeptRecord) {
|
||||
export function addDept(req: DeptRecord) {
|
||||
return axios.post(BASE_URL, req);
|
||||
}
|
||||
|
||||
|
@@ -44,7 +44,7 @@ export function getMenu(id: number) {
|
||||
return axios.get<MenuRecord>(`${BASE_URL}/${id}`);
|
||||
}
|
||||
|
||||
export function createMenu(req: MenuRecord) {
|
||||
export function addMenu(req: MenuRecord) {
|
||||
return axios.post(BASE_URL, req);
|
||||
}
|
||||
|
||||
|
@@ -23,9 +23,9 @@ export interface RoleRecord {
|
||||
export interface RoleParam {
|
||||
roleName?: string;
|
||||
status?: number;
|
||||
page: number;
|
||||
size: number;
|
||||
sort: Array<string>;
|
||||
page?: number;
|
||||
size?: number;
|
||||
sort?: Array<string>;
|
||||
}
|
||||
|
||||
export interface RoleListRes {
|
||||
@@ -46,7 +46,7 @@ export function getRole(id: number) {
|
||||
return axios.get<RoleRecord>(`${BASE_URL}/${id}`);
|
||||
}
|
||||
|
||||
export function createRole(req: RoleRecord) {
|
||||
export function addRole(req: RoleRecord) {
|
||||
return axios.post(BASE_URL, req);
|
||||
}
|
||||
|
||||
|
63
continew-admin-ui/src/api/system/user.ts
Normal file
63
continew-admin-ui/src/api/system/user.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'query-string';
|
||||
|
||||
const BASE_URL = '/system/user';
|
||||
|
||||
export interface UserRecord {
|
||||
userId?: number;
|
||||
username: string;
|
||||
nickname: string;
|
||||
gender: number;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
description?: string;
|
||||
roleIds?: Array<number>;
|
||||
deptId?: number;
|
||||
status?: number;
|
||||
createUserString?: string;
|
||||
createTime?: string;
|
||||
updateUserString?: string;
|
||||
updateTime?: string;
|
||||
deptName?: string;
|
||||
roleNames?: Array<string>;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface UserParam {
|
||||
username?: string;
|
||||
status?: number;
|
||||
createTime?: Array<string>;
|
||||
page?: number;
|
||||
size?: number;
|
||||
sort?: Array<string>;
|
||||
}
|
||||
|
||||
export interface UserListRes {
|
||||
list: UserRecord[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function listUser(params: UserParam) {
|
||||
return axios.get<UserListRes>(`${BASE_URL}`, {
|
||||
params,
|
||||
paramsSerializer: (obj) => {
|
||||
return qs.stringify(obj);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function getUser(id: number) {
|
||||
return axios.get<UserRecord>(`${BASE_URL}/${id}`);
|
||||
}
|
||||
|
||||
export function addUser(req: UserRecord) {
|
||||
return axios.post(BASE_URL, req);
|
||||
}
|
||||
|
||||
export function updateUser(req: UserRecord) {
|
||||
return axios.put(BASE_URL, req);
|
||||
}
|
||||
|
||||
export function deleteUser(ids: number | Array<number>) {
|
||||
return axios.delete(`${BASE_URL}/${ids}`);
|
||||
}
|
Reference in New Issue
Block a user