Files
oms-ui-admin/src/api/system/userManage/index.js
2024-07-02 17:40:15 +08:00

151 lines
3.4 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import request from '@/utils/request'
import qs from 'qs'
// 用户列表
//let tokens = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI2IiwiaXNzIjoiV0JLIiwiZXhwIjoxNjI5OTQxNjI1fQ.aOFOz0h7c8YQs-ti2GLpqeWu4AE9mifx_043hLJQf8g'
let tokens = window.sessionStorage.getItem('token');
export function userList(data){
return request({
url: '/wms/apiadmin/sysuser/listPage',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 新增
export function userAdd(data){
return request({
url: '/wms/apiadmin/sysuser/save',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 更新
export function userUpdata(data){
return request({
url: '/wms/apiadmin/sysuser/update/' +data.sid,
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 删除
export function delUser(data){
return request({
url: '/wms/apiadmin/sysuser/delBySid/' +data.sid,
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 初始化密码
export function initPwd(data){
return request({
url: '/wms/apiadmin/sysuser/initPwd/' +data.sid,
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 根据sid查询一条信息
export function userSingle(data){
return request({
url: '/wms/apiadmin/sysuser/fetchBySid/' +data.sid,
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 单条用户的角色列表
export function setRole(data){
return request({
url: '/wms/apiadmin/sysrole/listAllByUserSid/' +data.sid,
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 角色列表
export function saveOrgRole(data){
return request({
url: '/wms/apiadmin/sysuserrole/update',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 查询角色列表
export function roleList(data){
return request({
url: '/wms/apiadmin/sysrole/listAll',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 查询部门列表
export function orgList(data){
return request({
url: '/wms/apiadmin/sysorganization/list',
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 查询岗位列表
export function postList(data){
return request({
url: '/wms/apiadmin/syspost/fetchByOrgSid/'+data.sid,
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 获取验证码
export function getCode(data){
return request({
url: '/wms/apiadmin/sysuser/sendMessageCode/'+data.phone,
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
}
})
}
// 设置是否可用isEnable1可用0不可用
export function setRoleEnable(data) {
return request({
url: '/wms/apiadmin/sysuser/setIsEnable/' + data.sid + '/' + data.isEnable,
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json'
}
})
}