diff --git a/src/routes/dashboard/components/user.js b/src/routes/dashboard/components/user.js
index 384e05b..49d1400 100644
--- a/src/routes/dashboard/components/user.js
+++ b/src/routes/dashboard/components/user.js
@@ -13,7 +13,9 @@ const countUpProps = {
separator: ',',
}
-function User ({ avatar, name, email, sales, sold }) {
+function User ({
+ avatar, name, email, sales, sold,
+}) {
return (
diff --git a/src/routes/dashboard/components/weather.js b/src/routes/dashboard/components/weather.js
index defd58e..ad5b813 100644
--- a/src/routes/dashboard/components/weather.js
+++ b/src/routes/dashboard/components/weather.js
@@ -3,7 +3,9 @@ import PropTypes from 'prop-types'
import { Spin } from 'antd'
import styles from './weather.less'
-function Weather ({ city, icon, dateTime, temperature, name, loading }) {
+function Weather ({
+ city, icon, dateTime, temperature, name, loading,
+}) {
return (
diff --git a/src/routes/error/index.js b/src/routes/error/index.js
index 75fd68b..caa83ee 100644
--- a/src/routes/error/index.js
+++ b/src/routes/error/index.js
@@ -1,7 +1,7 @@
import React from 'react'
import { Icon } from 'antd'
-import styles from './index.less'
import { Page } from 'components'
+import styles from './index.less'
const Error = () => (
diff --git a/src/routes/request/index.js b/src/routes/request/index.js
index d6f5b6b..724787c 100644
--- a/src/routes/request/index.js
+++ b/src/routes/request/index.js
@@ -12,7 +12,9 @@ import {
import styles from './index.less'
const { api } = config
-const { dashboard, users, userLogin, user, v1test, v2test } = api
+const {
+ dashboard, users, userLogin, user, v1test, v2test,
+} = api
const requestOptions = [
{
@@ -125,21 +127,22 @@ export default class RequestPage extends React.Component {
,
})
request({ ...requestParams }).then((data) => {
- const state = this.state
+ const { state } = this
state.result = [this.state.result, 请求完成
{JSON.stringify(data)}
]
this.setState(state)
})
}
handeleURLChange = (value) => {
- const state = this.state
+ const { state } = this
const curretUrl = value.split('?')[0]
const curretMethod = value.split('?')[1]
const currntItem = requestOptions.filter((item) => {
const { method = 'get' } = item
return curretUrl === item.url && curretMethod === method
})
- state.currntRequest = currntItem[0]
+ const [currntRequest] = currntItem
+ state.currntRequest = currntRequest
this.setState(state)
}
diff --git a/src/routes/user/List.js b/src/routes/user/List.js
index abf1c03..4ec3dcc 100644
--- a/src/routes/user/List.js
+++ b/src/routes/user/List.js
@@ -8,9 +8,11 @@ import queryString from 'query-string'
import AnimTableBody from 'components/DataTable/AnimTableBody'
import styles from './List.less'
-const confirm = Modal.confirm
+const { confirm } = Modal
-const List = ({ onDeleteItem, onEditItem, isMotion, location, ...tableProps }) => {
+const List = ({
+ onDeleteItem, onEditItem, isMotion, location, ...tableProps
+}) => {
location.query = queryString.parse(location.search)
const handleMenuClick = (record, e) => {
@@ -33,7 +35,7 @@ const List = ({ onDeleteItem, onEditItem, isMotion, location, ...tableProps }) =
key: 'avatar',
width: 64,
className: styles.avatar,
- render: text =>
,
+ render: text =>
,
}, {
title: 'Name',
dataIndex: 'name',
diff --git a/src/routes/user/Modal.js b/src/routes/user/Modal.js
index ddb85b6..47141a6 100644
--- a/src/routes/user/Modal.js
+++ b/src/routes/user/Modal.js
@@ -78,7 +78,7 @@ const modal = ({
})(
Male
Female
- )}
+ )}
{getFieldDecorator('age', {
diff --git a/src/utils/request.js b/src/utils/request.js
index 08ba153..31c2a5f 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -20,7 +20,7 @@ const fetch = (options) => {
try {
let domin = ''
if (url.match(/[a-zA-z]+:\/\/[^/]*/)) {
- domin = url.match(/[a-zA-z]+:\/\/[^/]*/)[0]
+ [domin] = url.match(/[a-zA-z]+:\/\/[^/]*/)
url = url.slice(domin.length)
}
const match = pathToRegexp.parse(url)
@@ -113,6 +113,8 @@ export default function request (options) {
statusCode = 600
msg = error.message || 'Network Error'
}
+
+ /* eslint-disable */
return Promise.reject({ success: false, statusCode, message: msg })
})
}