商享通oms管理后台
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.

177 lines
3.8 KiB

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