ludu-cloud/admin-web/src/services/system.js
YunaiV 0763551d6d 1. 迁移角色相关逻辑
2. admin-web 接入角色新接口
2020-04-29 00:42:33 +08:00

79 lines
1.9 KiB
Java

import {stringify} from '@/utils/request.qs';
import request from '@/utils/request';
// ========== OAuth2 模块 ==========
export async function oauth2UsernameAuthenticate(params) {
return request(`/system-api/admins/oauth2/username-authenticate?${stringify(params)}`, {
method: 'POST',
body: {},
});
}
// ========== Authorization 模块 ==========
export async function authorizationMenuResourceTree() {
return request('/system-api/admins/authorization/menu-resource-tree', {
method: 'GET',
});
}
export async function authorizationResourcePermissions(params) {
return request(`/system-api/admins/authorization/resource-permissions`, {
method: 'GET',
});
}
// ========== Resource 模块 ==========
export async function resourceTree(params) {
return request(`/system-api/admins/resource/tree`, {
method: 'GET',
});
}
export async function resourceAdd(params) {
return request(`/system-api/admins/resource/add?${stringify(params)}`, {
method: 'POST',
});
}
export async function resourceUpdate(params) {
return request(`/system-api/admins/resource/update?${stringify(params)}`, {
method: 'POST',
});
}
export async function resourceDelete(params) {
return request(`/system-api/admins/resource/delete?${stringify(params)}`, {
method: 'POST',
});
}
// ========== Role 模块 ==========
export async function rolePage(params) {
return request(`/system-api/admins/role/page?${stringify(params)}`);
}
export async function roleDelete(params) {
return request(`/system-api/admins/role/delete?${stringify(params)}`, {
method: 'POST',
body: {},
});
}
export async function roleAdd(params) {
return request(`/system-api/admins/role/add?${stringify(params)}`, {
method: 'POST',
body: {},
});
}
export async function roleUpdate(params) {
return request(`/system-api/admins/role/update?${stringify(params)}`, {
method: 'POST',
body: {},
});
}