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

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