Rolemanagement.js 671 Bytes
import request from "@/utils/request";
import SERVER from "./config";
import { getParams } from './util'
import {
  api,
  getAction,
  postAction,
  deleteAction,
  putAction
} from './manageApi'

/** 角色管理开始 */
// 获取角色列表 by categoryId
export const getRolesById = categoryId => {
  const conditionGroup = {
    conditions: [
      {
        property: 'category',
        value: categoryId,
        operator: 'EQ'
      }
    ],
    queryRelation: 'AND'
  }
  const params = getParams(conditionGroup)
  return getAction(api.roles, params)
}
// 人员列表
export const getUserRoles = (id) => {
  return getAction(`${api.userRoles}/${id}/users`)
}