This commit is contained in:
sjl
2024-11-07 19:25:45 +08:00
parent 4b32e1f215
commit f72b5300be
7 changed files with 201 additions and 220 deletions

View File

@@ -1,5 +1,5 @@
// 登录模块
import type { ReqPage } from '@/api/interface'
import type { ReqPage,ResPage } from '@/api/interface'
export namespace Login {
export interface ReqLoginForm {
@@ -18,21 +18,42 @@ export namespace Login {
// 用户管理模块
export namespace User {
/**
* 用户数据表格分页查询参数
*/
export interface ReqUserParams extends ReqPage{
id: string; // 装置序号用户ID 必填
name: string; //用户名(别名)
loginTime?: string;//最后一次登录时间
}
// 用户接口
export interface UserBO {
id?: string; //用户ID作为唯一标识
export interface ResUser {
id: string; //用户ID作为唯一标识
name: string; //用户名(别名)
loginName: string;//登录名
deptId?: number;//部门ID
password: string; //密码
phone?: string; //手机号
email?: string; //邮箱
loginTime?: string;//最后一次登录时间
loginErrorTimes: number;//登录错误次数
lockTime?: string; //用户密码错误锁定时间
createBy?: string;//创建用户
createTime?: string;//创建时间
updateBy?: string;//更新用户
updateTime?: string;//更新时间
}
// 用户+分页
export interface ReqUserParams extends ReqPage,UserBO {
}
/**
* 用户表格查询分页返回的对象;
*/
export interface ResUserPage extends ResPage<ResUser> {
}
// // 用户+分页
// export interface ReqUserParams extends ReqPage,UserBO {
// }
}

View File

@@ -1,5 +1,5 @@
import { ResPage } from '@/api/interface'
import { User } from './interface'
import type { ResPage } from '@/api/interface'
import type { User } from './interface'
import { ADMIN as rePrefix } from '@/api/config/serviceName'
import http from '@/api'
@@ -8,7 +8,7 @@ import http from '@/api'
*/
// 获取用户列表
export const getUserList = (params: User.ReqUserParams) => {
return http.post<ResPage<User.UserBO>>(`/user/list`, params)
return http.post(`/user/list`, params)
}
// 获取树形用户列表
@@ -17,22 +17,22 @@ export const getUserList = (params: User.ReqUserParams) => {
// }
// 新增用户
export const addUser = (params: User.UserBO) => {
export const addUser = (params: User.ResUser) => {
return http.post(`/user/add`, params)
}
// 批量添加用户
export const BatchAddUser = (params: FormData) => {
return http.post(`${rePrefix}/user/import`, params)
export const BatchAddUser = (params: User.ReqUserParams) => {
return http.post(`$/user/import`, params)
}
// 编辑用户
export const editUser = (params: User.UserBO) => {
return http.post(`/user/edit`, params)
export const updateUser = (params: User.ResUser) => {
return http.post(`/user/update`, params)
}
// 删除用户
export const deleteUser = (params: { id: string[] }) => {
export const deleteUser = (params: string[] ) => {
return http.post(`/user/delete`, params)
}