|
|
|
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: '/oms/apiadmin/sysuser/listPage',
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 新增
|
|
|
|
export function userAdd(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysstaffinfo/save',
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 初始化 用户
|
|
|
|
export function initUserInfo(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysstaffinfo/fetchBySid/' + data.sid,
|
|
|
|
method: 'get',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 更新
|
|
|
|
export function userUpdata(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysstaffinfo/update/' + data.sid,
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除
|
|
|
|
export function delUser(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysuser/delBySid/' + data.sid,
|
|
|
|
method: 'get',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 初始化密码
|
|
|
|
export function initPwd(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysuser/initPwd/' + data.sid,
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 根据sid查询一条信息
|
|
|
|
export function userSingle(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysuser/fetchBySid/' + data.sid,
|
|
|
|
method: 'get',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 单条用户的角色列表
|
|
|
|
export function setRole(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysrole/listAllByUserSid/' + data.userSid + "/" + data.orgsid,
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 角色列表
|
|
|
|
export function saveOrgRole(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysuserrole/update',
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 查询角色列表
|
|
|
|
export function roleList(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysrole/listAll',
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 查询部门列表
|
|
|
|
export function orgList(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysorganization/list/' + data,
|
|
|
|
method: 'get',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 查询岗位列表
|
|
|
|
export function postList(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/syspost/fetchByOrgSid/' + data.sid,
|
|
|
|
method: 'get',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取验证码
|
|
|
|
export function getCode(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysuser/sendMessageCode/' + data.phone,
|
|
|
|
method: 'get',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'token': tokens
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 设置是否可用:isEnable:1可用,0不可用
|
|
|
|
export function setRoleEnable(data) {
|
|
|
|
return request({
|
|
|
|
url: '/oms/apiadmin/sysuser/setIsEnable/' + data.sid + '/' + data.isEnable,
|
|
|
|
method: 'post',
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|