import { request } from 'umi' ; export async function queryUsers ( params ? ) { return request ( 'users' , { params , } ) ; } export async function getUserRoles ( userId ) { return request ( `users/${ userId }/roles` ) ; } export async function getUserPermissions ( userId ) { return request ( `users/${ userId }/permissions` ) ; } export async function assignPermissions ( userId , data ) { return request ( `users/${ userId }/assign_permissions` , { method : 'POST' , data , } ) ; } export async function assignRoles ( userId , data ) { return request ( `users/${ userId }/assign_roles` , { method : 'POST' , data , } ) ; }