mt-ck-wms-ui/src/api/role.js
2021-09-13 14:56:28 +08:00

88 lines
1.5 KiB
JavaScript

/*
* @Date: 2020-12-14 09:07:03
* @LastEditors: zwq
* @LastEditTime: 2021-07-21 15:48:05
* @FilePath: \basic-admin\src\api\role.js
* @Description: 角色权限api接口定义
*/
import request from '@/utils/request'
// 获取角色详细信息
export function getRoleInfo(data) {
return request({
url: `/upms/role/get`,
method: 'post',
data
})
}
export function RoleCode() { // 获取code
return request({
url: '/upms/role/get-code',
method: 'post'
})
}
// 获取角色列表
export function getRoleList(data) {
return request({
url: '/upms/role/list',
method: 'post',
data
})
}
// 添加角色
export function addRole(data) {
return request({
url: '/upms/role/add',
method: 'post',
data
})
}
// 修改角色
export function updateRole(data) {
return request({
url: '/upms/role/update',
method: 'post',
data
})
}
// 删除角色
export function deleteRole(data) {
return request({
url: `/upms/role/delete`,
method: 'post',
data
})
}
// 启停角色
export function enableRole(data) {
return request({
url: `/upms/role/enabled`,
method: 'post',
data
})
}
// 用户-角色关联授权
export function saveUserRole(data) {
return request({
url: '/upms/role/saveUserRole',
method: 'post',
data
})
}
// 用户-角色关联获取
export function listByUser(id) {
return request({
url: '/upms/role/listByUser',
method: 'post',
data: { id }
})
}