mirror of
https://github.com/zuiidea/antd-admin
synced 2026-11-18 17:25:07 +00:00
requestPage
This commit is contained in:
+6
-1
@@ -9,9 +9,14 @@ module.exports = [
|
||||
name: '用户管理',
|
||||
icon: 'user',
|
||||
},
|
||||
{
|
||||
key: 'request',
|
||||
name: 'Request',
|
||||
icon: 'api',
|
||||
},
|
||||
{
|
||||
key: 'UIElement',
|
||||
name: 'UI组件',
|
||||
name: 'UI Element',
|
||||
icon: 'camera-o',
|
||||
clickable: false,
|
||||
child: [
|
||||
|
||||
@@ -3,7 +3,11 @@ import qs from 'qs'
|
||||
import config from './config'
|
||||
|
||||
const fetch = (options) => {
|
||||
const { method = 'get', data, url } = options
|
||||
const {
|
||||
method = 'get',
|
||||
data,
|
||||
url,
|
||||
} = options
|
||||
switch (method.toLowerCase()) {
|
||||
case 'get':
|
||||
return axios.get(url, { params: data })
|
||||
@@ -33,5 +37,7 @@ export default function request (options) {
|
||||
|
||||
return fetch(options).then((result) => {
|
||||
return result.data
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user