mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-24 18:58:42 +08:00
feat: 新增用户管理
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
export * from './user'
|
||||
export * from './role'
|
||||
export * from './menu'
|
||||
export * from './dept'
|
||||
|
@@ -1,3 +1,36 @@
|
||||
/** 系统用户类型 */
|
||||
export interface UserResp {
|
||||
id: string
|
||||
username: string
|
||||
nickname: string
|
||||
avatar: string
|
||||
gender: number
|
||||
email: string
|
||||
phone: string
|
||||
description: string
|
||||
status: 1 | 2
|
||||
isSystem?: boolean
|
||||
createUserString: string
|
||||
createTime: string
|
||||
updateUserString: string
|
||||
updateTime: string
|
||||
deptId: string
|
||||
deptName: string
|
||||
disabled: boolean
|
||||
}
|
||||
export type UserDetailResp = UserResp & {
|
||||
roleIds?: Array<number>
|
||||
roleNames: string
|
||||
pwdResetTime?: string
|
||||
}
|
||||
export interface UserQuery {
|
||||
description?: string
|
||||
status?: number
|
||||
deptId?: string
|
||||
sort: Array<string>
|
||||
}
|
||||
export interface UserPageQuery extends PageQuery, UserQuery {}
|
||||
|
||||
/** 系统角色类型 */
|
||||
export interface RoleResp {
|
||||
id: string
|
||||
|
39
src/apis/system/user.ts
Normal file
39
src/apis/system/user.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import http from '@/utils/http'
|
||||
import type * as System from './type'
|
||||
|
||||
const BASE_URL = '/system/user'
|
||||
|
||||
/** @desc 查询用户列表 */
|
||||
export function listUser(query: System.UserPageQuery) {
|
||||
return http.get<PageRes<System.UserResp[]>>(`${BASE_URL}`, query)
|
||||
}
|
||||
|
||||
/** @desc 查询用户详情 */
|
||||
export function getUser(id: string) {
|
||||
return http.get<System.UserDetailResp>(`${BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
/** @desc 新增用户 */
|
||||
export function addUser(data: any) {
|
||||
return http.post(`${BASE_URL}`, data)
|
||||
}
|
||||
|
||||
/** @desc 修改用户 */
|
||||
export function updateUser(data: any, id: string) {
|
||||
return http.put(`${BASE_URL}/${id}`, data)
|
||||
}
|
||||
|
||||
/** @desc 删除用户 */
|
||||
export function deleteUser(ids: string | Array<string>) {
|
||||
return http.del(`${BASE_URL}/${ids}`)
|
||||
}
|
||||
|
||||
/** @desc 导出用户 */
|
||||
export function exportUser(query: System.UserQuery) {
|
||||
return http.download<any>(`${BASE_URL}/export`, query)
|
||||
}
|
||||
|
||||
/** @desc 重置密码 */
|
||||
export function resetUserPwd(data: any, id: string) {
|
||||
return http.patch(`${BASE_URL}/${id}/password`, data)
|
||||
}
|
Reference in New Issue
Block a user