用户角色管理接口新增
This commit is contained in:
parent
b525a67a09
commit
71164b0cd5
51
src/api/role/index.ts
Normal file
51
src/api/role/index.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import request from '/@/utils/request';
|
||||||
|
import { baseUrlHost } from '../baseUrlHost';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参)
|
||||||
|
* 注意在写get请求时,参数是params,而不是data,要标注好
|
||||||
|
*
|
||||||
|
* 登录api接口集合
|
||||||
|
* @method getRoleList 获取角色列表
|
||||||
|
* @method deleteRole 删除角色
|
||||||
|
* @method saveRole 保存角色
|
||||||
|
* @method updateRole 更新角色
|
||||||
|
* @method getRoleDetail 查询单个角色
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function RoleApi() {
|
||||||
|
return {
|
||||||
|
getRoleList: () => {
|
||||||
|
return request({
|
||||||
|
url: baseUrlHost + '/acGroup',
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteRole: (id: Number) => {
|
||||||
|
return request({
|
||||||
|
url: baseUrlHost + `/acGroup/${id}`,
|
||||||
|
method: 'delete',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getRoleDetail: (id: Number) => {
|
||||||
|
return request({
|
||||||
|
url: baseUrlHost + `/acGroup/${id}`,
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
saveRole: (data: object) => {
|
||||||
|
return request({
|
||||||
|
url: baseUrlHost + '/acGroup',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
updateRole: (data: object) => {
|
||||||
|
return request({
|
||||||
|
url: baseUrlHost + '/acGroup',
|
||||||
|
method: 'put',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user