You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
3.0 KiB
120 lines
3.0 KiB
import request from '@/config/axios'
|
|
|
|
export interface UserVO {
|
|
id : number
|
|
username : string
|
|
nickname : string
|
|
deptId : number
|
|
postIds : string[]
|
|
email : string
|
|
mobile : string
|
|
sex : number
|
|
avatar : string
|
|
loginIp : string
|
|
status : number
|
|
remark : string
|
|
loginDate : Date
|
|
createTime : Date
|
|
userType : string
|
|
mailKey : string
|
|
}
|
|
|
|
export const getUserPage = async (params) => {
|
|
console.log(params)
|
|
if (params.isSearch) {
|
|
delete params.isSearch
|
|
const data = { ...params }
|
|
return await request.post({ url: '/system/user/senior', data })
|
|
} else {
|
|
return await request.get({ url: '/system/user/page', params })
|
|
}
|
|
}
|
|
|
|
// 查询用户管理列表
|
|
// export const getUserPage = (params: PageParam) => {
|
|
// return request.get({ url: '/system/user/page', params })
|
|
// }
|
|
|
|
// 查询用户详情
|
|
export const getUser = (id : number) => {
|
|
return request.get({ url: '/system/user/get?id=' + id })
|
|
}
|
|
|
|
// 新增用户
|
|
export const createUser = (data : UserVO) => {
|
|
return request.post({ url: '/system/user/create', data })
|
|
}
|
|
|
|
// 修改用户
|
|
export const updateUser = (data : UserVO) => {
|
|
return request.put({ url: '/system/user/update', data })
|
|
}
|
|
|
|
// 删除用户
|
|
export const deleteUser = (id : number) => {
|
|
return request.delete({ url: '/system/user/delete?id=' + id })
|
|
}
|
|
// 解冻用户
|
|
export const unLockUser = (id : number) => {
|
|
return request.get({ url: '/system/user/unLockUser?id=' + id })
|
|
}
|
|
// 导出用户
|
|
export const exportUser = (params) => {
|
|
return request.download({ url: '/system/user/export', params })
|
|
}
|
|
|
|
// 下载用户导入模板
|
|
export const importUserTemplate = () => {
|
|
return request.download({ url: '/system/user/get-import-template' })
|
|
}
|
|
|
|
// 用户密码重置
|
|
export const resetUserPwd = (id : number, password : string) => {
|
|
const data = {
|
|
id,
|
|
password
|
|
}
|
|
return request.put({ url: '/system/user/update-password', data: data })
|
|
}
|
|
|
|
// 用户状态修改
|
|
export const updateUserStatus = (id : number, status : number) => {
|
|
const data = {
|
|
id,
|
|
status
|
|
}
|
|
return request.put({ url: '/system/user/update-status', data: data })
|
|
}
|
|
|
|
// 获取用户精简信息列表
|
|
export const getSimpleUserList = () : Promise<UserVO[]> => {
|
|
return request.get({ url: '/system/user/list-all-simple' })
|
|
}
|
|
|
|
// 忘记密码
|
|
export const forgetPassword = (data : UserVO) => {
|
|
return request.put({ url: '/system/user/forgetPassword', data })
|
|
}
|
|
|
|
// 忘记密码->修改密码
|
|
export const updatePassword = (data : UserVO) => {
|
|
return request.put({ url: '/system/user/updatePassword', data })
|
|
}
|
|
// 重置密码
|
|
export const updateUserPassword = (data : UserVO) => {
|
|
return request.put({ url: '/system/user/update-password', data })
|
|
}
|
|
|
|
export const getPassWordConfig = () => {
|
|
return request.get({ url: '/system/password/getConfig' })
|
|
}
|
|
// 查询用户详情
|
|
export const getUserListByDeptIds = (data : Array<number>) => {
|
|
return request.post({ url: '/system/user/getUserListByDeptIds', data })
|
|
}
|
|
// 获取全部用户
|
|
export const getUserListAll = () => {
|
|
return request.get({ url: '/system/user/listAll' })
|
|
}
|
|
|
|
|
|
|