2020-04-27 00:21:37 +08:00
|
|
|
import {stringify} from '@/utils/request.qs';
|
2020-04-26 19:52:14 +08:00
|
|
|
import request from '@/utils/request';
|
|
|
|
|
2020-04-27 00:08:28 +08:00
|
|
|
// ========== OAuth2 模块 ==========
|
2020-04-26 19:52:14 +08:00
|
|
|
|
2020-04-27 00:08:28 +08:00
|
|
|
export async function oauth2UsernameAuthenticate(params) {
|
2020-04-26 19:52:14 +08:00
|
|
|
return request(`/system-api/admins/oauth2/username-authenticate?${stringify(params)}`, {
|
|
|
|
method: 'POST',
|
|
|
|
body: {},
|
|
|
|
});
|
|
|
|
}
|
2020-04-27 00:08:28 +08:00
|
|
|
|
|
|
|
// ========== Authorization 模块 ==========
|
|
|
|
|
|
|
|
export async function authorizationMenuResourceTree() {
|
|
|
|
return request('/system-api/admins/authorization/menu-resource-tree', {
|
2020-04-27 00:21:37 +08:00
|
|
|
method: 'GET',
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function authorizationResourcePermissions(params) {
|
|
|
|
return request(`/system-api/admins/authorization/resource-permissions`, {
|
|
|
|
method: 'GET',
|
2020-04-27 00:08:28 +08:00
|
|
|
});
|
|
|
|
}
|
2020-04-27 19:48:58 +08:00
|
|
|
|
2020-04-29 21:57:09 +08:00
|
|
|
export async function authorizationRoleResourceTree(params) {
|
|
|
|
return request(`/system-api/admins/authorization/role_resource_tree?${stringify(params)}`, {
|
|
|
|
method: 'GET',
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function authorizationRoleAssignResource(params) {
|
|
|
|
return request(`/system-api/admins/authorization/assign_role_resource?${stringify(params)}`, {
|
|
|
|
method: 'POST',
|
|
|
|
body: {},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-04-27 19:48:58 +08:00
|
|
|
// ========== 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',
|
|
|
|
});
|
|
|
|
}
|
2020-04-29 00:42:33 +08:00
|
|
|
|
|
|
|
// ========== 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: {},
|
|
|
|
});
|
|
|
|
}
|
2020-05-01 11:04:16 +08:00
|
|
|
|
|
|
|
// ========== Admin 模块 ==========
|
|
|
|
|
|
|
|
export async function adminPage(params) {
|
|
|
|
return request(`/system-api/admins/admin/page?${stringify(params)}`, {
|
|
|
|
method: 'GET',
|
|
|
|
});
|
|
|
|
}
|