From 3b3dec6ab272634629e389e6f30cf4d7a7f8ba65 Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Wed, 6 Mar 2019 20:08:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20resource=20api=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E5=88=B0=20admin=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-web/src/services/admin.js | 55 ++++++++++++++++++++++++++++++ admin-web/src/services/resource.js | 26 -------------- 2 files changed, 55 insertions(+), 26 deletions(-) delete mode 100644 admin-web/src/services/resource.js diff --git a/admin-web/src/services/admin.js b/admin-web/src/services/admin.js index c4a28d167..94718e1d0 100644 --- a/admin-web/src/services/admin.js +++ b/admin-web/src/services/admin.js @@ -1,6 +1,8 @@ import { stringify } from 'qs'; import request from '@/utils/request'; +// auth + export async function getAdminMenus() { return request('/admin-api/admin/resource/admin_menu_tree'); } @@ -8,3 +10,56 @@ export async function getAdminMenus() { export async function getAdminUrls(params) { return request(`/admin-api/admin/resource/admin_url_list?${stringify(params)}`); } + +// resource + +export async function addResource(params) { + return request(`/admin-api/admin/resource/add?${stringify(params)}`, { + method: 'POST', + }); +} + +export async function updateResource(params) { + return request(`/admin-api/admin/resource/update?${stringify(params)}`, { + method: 'POST', + }); +} + +export async function deleteResource(params) { + return request(`/admin-api/admin/resource/delete?${stringify(params)}`, { + method: 'POST', + }); +} + +export async function resourceTree(params) { + return request(`/admin-api/admin/resource/tree?${stringify(params)}`, { + method: 'GET', + }); +} + +// role + +export async function queryRole(params) { + return request(`/admin-api/admin/role/page?${stringify(params)}`); +} + +export async function deleteRole(params) { + return request(`/admin-api/admin/role/delete?${stringify(params)}`, { + method: 'POST', + body: {}, + }); +} + +export async function addRole(params) { + return request(`/admin-api/admin/role/add?${stringify(params)}`, { + method: 'POST', + body: {}, + }); +} + +export async function updateRole(params) { + return request(`/admin-api/admin/role/update?${stringify(params)}`, { + method: 'POST', + body: {}, + }); +} diff --git a/admin-web/src/services/resource.js b/admin-web/src/services/resource.js deleted file mode 100644 index 4ec1a0a41..000000000 --- a/admin-web/src/services/resource.js +++ /dev/null @@ -1,26 +0,0 @@ -import { stringify } from 'qs'; -import request from '@/utils/request'; - -export async function addResource(params) { - return request(`/admin-api/admin/resource/add?${stringify(params)}`, { - method: 'POST', - }); -} - -export async function updateResource(params) { - return request(`/admin-api/admin/resource/update?${stringify(params)}`, { - method: 'POST', - }); -} - -export async function deleteResource(params) { - return request(`/admin-api/admin/resource/delete?${stringify(params)}`, { - method: 'POST', - }); -} - -export async function resourceTree(params) { - return request(`/admin-api/admin/resource/tree?${stringify(params)}`, { - method: 'GET', - }); -}