From 3c1a8972f9ba354c58a1ddc0e0e1b96a44634ac5 Mon Sep 17 00:00:00 2001 From: smallchill Date: Fri, 22 Feb 2019 21:49:38 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/dept/notice.js | 10 ++++------ src/api/system/dept.js | 12 +++++------- src/api/system/dict.js | 12 +++++------- src/api/system/menu.js | 12 +++++------- src/api/system/param.js | 12 +++++------- src/api/system/role.js | 17 ++++++----------- src/api/system/user.js | 7 ++++--- src/api/tool/code.js | 7 ++----- src/api/user.js | 5 +---- 9 files changed, 37 insertions(+), 57 deletions(-) diff --git a/src/api/dept/notice.js b/src/api/dept/notice.js index 8878de8..0e77f6b 100644 --- a/src/api/dept/notice.js +++ b/src/api/dept/notice.js @@ -4,10 +4,11 @@ export const getList = (current, size, params) => { return request({ url: 'api/blade-desk/notice/list', method: 'get', - params: Object.assign(params, { + params: { + ...params, current, size, - }) + } }) } @@ -15,11 +16,8 @@ export const remove = (ids) => { return request({ url: 'api/blade-desk/notice/remove', method: 'post', - data: { + params: { ids, - }, - meta: { - isSerialize: true, } }) } diff --git a/src/api/system/dept.js b/src/api/system/dept.js index 32f4354..e458fde 100644 --- a/src/api/system/dept.js +++ b/src/api/system/dept.js @@ -4,21 +4,19 @@ export const getList = (current, size, params) => { return request({ url: 'api/blade-system/dept/list', method: 'get', - params: Object.assign(params, { + params: { + ...params, current, - size - }) + size, + } }) } export const remove = (ids) => { return request({ url: 'api/blade-system/dept/remove', method: 'post', - data: { + params: { ids, - }, - meta: { - isSerialize: true, } }) } diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 85a3071..e328f98 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -4,21 +4,19 @@ export const getList = (current, size, params) => { return request({ url: 'api/blade-system/dict/list', method: 'get', - params: Object.assign(params, { + params: { + ...params, current, - size - }) + size, + } }) } export const remove = (ids) => { return request({ url: 'api/blade-system/dict/remove', method: 'post', - data: { + params: { ids, - }, - meta: { - isSerialize: true, } }) } diff --git a/src/api/system/menu.js b/src/api/system/menu.js index 7e187ad..dd191da 100644 --- a/src/api/system/menu.js +++ b/src/api/system/menu.js @@ -4,21 +4,19 @@ export const getList = (current, size, params) => { return request({ url: 'api/blade-system/menu/list', method: 'get', - params: Object.assign(params, { + params: { + ...params, current, - size - }) + size, + } }) } export const remove = (ids) => { return request({ url: 'api/blade-system/menu/remove', method: 'post', - data: { + params: { ids, - }, - meta: { - isSerialize: true, } }) } diff --git a/src/api/system/param.js b/src/api/system/param.js index eccd236..41bbd43 100644 --- a/src/api/system/param.js +++ b/src/api/system/param.js @@ -4,21 +4,19 @@ export const getList = (current, size, params) => { return request({ url: 'api/blade-system/param/list', method: 'get', - params: Object.assign(params, { + params: { + ...params, current, - size - }) + size, + } }) } export const remove = (ids) => { return request({ url: 'api/blade-system/param/remove', method: 'post', - data: { + params: { ids, - }, - meta: { - isSerialize: true, } }) } diff --git a/src/api/system/role.js b/src/api/system/role.js index c03683a..92b8f44 100644 --- a/src/api/system/role.js +++ b/src/api/system/role.js @@ -4,10 +4,11 @@ export const getList = (current, size, params) => { return request({ url: 'api/blade-system/role/list', method: 'get', - params: Object.assign(params, { + params: { + ...params, current, - size - }) + size, + } }) } export const getTree = () => { @@ -21,12 +22,9 @@ export const grant = (roleIds, menuIds) => { return request({ url: 'api/blade-system/role/grant', method: 'post', - data: { + params: { roleIds, menuIds - }, - meta: { - isSerialize: true, } }) } @@ -35,11 +33,8 @@ export const remove = (ids) => { return request({ url: 'api/blade-system/role/remove', method: 'post', - data: { + params: { ids, - }, - meta: { - isSerialize: true, } }) } diff --git a/src/api/system/user.js b/src/api/system/user.js index cca860a..dd2a917 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -13,10 +13,11 @@ export const getList = (current, size, params) => { return request({ url: 'api/blade-user/list', method: 'get', - params: Object.assign(params, { + params: { + ...params, current, - size - }) + size, + } }) } export const remove = (ids) => { diff --git a/src/api/tool/code.js b/src/api/tool/code.js index aa94924..d68e654 100644 --- a/src/api/tool/code.js +++ b/src/api/tool/code.js @@ -15,7 +15,7 @@ export const build = (ids) => { return request({ url: 'api/blade-develop/code/gen-code', method: 'post', - data: { + params: { ids, } }) @@ -24,11 +24,8 @@ export const remove = (ids) => { return request({ url: 'api/blade-develop/code/remove', method: 'post', - data: { + params: { ids, - }, - meta: { - isSerialize: true, } }) } diff --git a/src/api/user.js b/src/api/user.js index f2c23f1..d371765 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -4,13 +4,10 @@ import {baseUrl} from '@/config/env'; export const loginByUsername = (account, password, type) => request({ url: 'api/blade-auth/token', method: 'post', - data: { + params: { account, password, type - }, - meta: { - isSerialize: true, } })