From 304574aac8e116e106f3519831a1cad59bfe226c Mon Sep 17 00:00:00 2001 From: sorrycc Date: Wed, 15 Aug 2018 07:53:13 +0800 Subject: [PATCH] code style, use @/layouts/ and remove /index affix --- src/components/Authorized/Secured.js | 2 +- src/layouts/BasicLayout.js | 4 ++-- src/layouts/Footer.js | 2 +- src/layouts/Header.js | 4 ++-- src/layouts/UserLayout.js | 2 +- src/pages/Account/Center/Center.js | 2 +- src/pages/Account/Settings/Info.js | 2 +- src/pages/Dashboard/Analysis.js | 6 +++--- src/pages/Dashboard/Monitor.js | 4 ++-- src/pages/Forms/AdvancedForm.js | 2 +- src/pages/Forms/BasicForm.js | 2 +- src/pages/Forms/StepForm/index.js | 2 +- src/pages/List/BasicList.js | 4 ++-- src/pages/List/CardList.js | 2 +- src/pages/List/List.js | 2 +- src/pages/List/TableList.js | 2 +- src/pages/Profile/AdvancedProfile.js | 2 +- src/pages/Profile/BasicProfile.js | 2 +- 18 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/Authorized/Secured.js b/src/components/Authorized/Secured.js index d31cc565..70546813 100644 --- a/src/components/Authorized/Secured.js +++ b/src/components/Authorized/Secured.js @@ -1,5 +1,5 @@ import React from 'react'; -import Exception from '../Exception/index'; +import Exception from '../Exception'; import CheckPermissions from './CheckPermissions'; /** * 默认不能访问任何页面 diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 4c1596a9..e2341045 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -7,9 +7,9 @@ import { ContainerQuery } from 'react-container-query'; import classNames from 'classnames'; import pathToRegexp from 'path-to-regexp'; import { formatMessage } from 'umi/locale'; -import SiderMenu from '../components/SiderMenu/index'; +import SiderMenu from '../components/SiderMenu'; import Authorized from '../utils/Authorized'; -import SettingDarwer from '../components/SettingDarwer/index'; +import SettingDarwer from '../components/SettingDarwer'; import logo from '../assets/logo.svg'; import Footer from './Footer'; import Header from './Header'; diff --git a/src/layouts/Footer.js b/src/layouts/Footer.js index e1c6e816..5c346a52 100644 --- a/src/layouts/Footer.js +++ b/src/layouts/Footer.js @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; import { Layout, Icon } from 'antd'; -import GlobalFooter from '../components/GlobalFooter/index'; +import GlobalFooter from '../components/GlobalFooter'; const { Footer } = Layout; const FooterView = () => ( diff --git a/src/layouts/Header.js b/src/layouts/Header.js index c1d0c524..afb2c7d0 100644 --- a/src/layouts/Header.js +++ b/src/layouts/Header.js @@ -3,8 +3,8 @@ import { Layout, message } from 'antd'; import Animate from 'rc-animate'; import { connect } from 'dva'; import { routerRedux } from 'dva/router'; -import GlobalHeader from '../components/GlobalHeader/index'; -import TopNavHeader from '../components/TopNavHeader/index'; +import GlobalHeader from '../components/GlobalHeader'; +import TopNavHeader from '../components/TopNavHeader'; import styles from './Header.less'; import Authorized from '../utils/Authorized'; diff --git a/src/layouts/UserLayout.js b/src/layouts/UserLayout.js index 3eb766c9..40eb7ae8 100644 --- a/src/layouts/UserLayout.js +++ b/src/layouts/UserLayout.js @@ -1,7 +1,7 @@ import React, { Fragment } from 'react'; import { Link } from 'dva/router'; import { Icon } from 'antd'; -import GlobalFooter from '../components/GlobalFooter/index'; +import GlobalFooter from '../components/GlobalFooter'; import styles from './UserLayout.less'; import logo from '../assets/logo.svg'; diff --git a/src/pages/Account/Center/Center.js b/src/pages/Account/Center/Center.js index 9609ca3a..903e2ed8 100644 --- a/src/pages/Account/Center/Center.js +++ b/src/pages/Account/Center/Center.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; import { Link, routerRedux } from 'dva/router'; import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd'; -import GridContent from '../../../layouts/GridContent'; +import GridContent from '@/layouts/GridContent'; import styles from './Center.less'; @connect(({ loading, user, project }) => ({ diff --git a/src/pages/Account/Settings/Info.js b/src/pages/Account/Settings/Info.js index bf52a482..f53986f2 100644 --- a/src/pages/Account/Settings/Info.js +++ b/src/pages/Account/Settings/Info.js @@ -4,7 +4,7 @@ import { routerRedux } from 'dva/router'; import { FormattedMessage } from 'umi/locale'; import { Menu } from 'antd'; import styles from './Info.less'; -import GridContent from '../../../layouts/GridContent'; +import GridContent from '@/layouts/GridContent'; const { Item } = Menu; diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index 33034b6d..5f3b37f0 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -27,9 +27,9 @@ import { import Trend from 'components/Trend'; import NumberInfo from 'components/NumberInfo'; import numeral from 'numeral'; -import GridContent from '../../layouts/GridContent'; -import Yuan from '../../utils/Yuan'; -import { getTimeDistance } from '../../utils/utils'; +import GridContent from '@/layouts/GridContent'; +import Yuan from '@/utils/Yuan'; +import { getTimeDistance } from '@/utils/utils'; import styles from './Analysis.less'; diff --git a/src/pages/Dashboard/Monitor.js b/src/pages/Dashboard/Monitor.js index d8f1aa0c..54b3970e 100644 --- a/src/pages/Dashboard/Monitor.js +++ b/src/pages/Dashboard/Monitor.js @@ -6,9 +6,9 @@ import NumberInfo from 'components/NumberInfo'; import CountDown from 'components/CountDown'; import ActiveChart from 'components/ActiveChart'; import numeral from 'numeral'; -import GridContent from '../../layouts/GridContent'; +import GridContent from '@/layouts/GridContent'; -import Authorized from '../../utils/Authorized'; +import Authorized from '@/utils/Authorized'; import styles from './Monitor.less'; const { Secured } = Authorized; diff --git a/src/pages/Forms/AdvancedForm.js b/src/pages/Forms/AdvancedForm.js index fdaa61ba..b9e5ffc6 100644 --- a/src/pages/Forms/AdvancedForm.js +++ b/src/pages/Forms/AdvancedForm.js @@ -14,7 +14,7 @@ import { } from 'antd'; import { connect } from 'dva'; import FooterToolbar from 'components/FooterToolbar'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import TableForm from './TableForm'; import styles from './style.less'; diff --git a/src/pages/Forms/BasicForm.js b/src/pages/Forms/BasicForm.js index a971a33e..b6067ecd 100644 --- a/src/pages/Forms/BasicForm.js +++ b/src/pages/Forms/BasicForm.js @@ -12,7 +12,7 @@ import { Icon, Tooltip, } from 'antd'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './style.less'; const FormItem = Form.Item; diff --git a/src/pages/Forms/StepForm/index.js b/src/pages/Forms/StepForm/index.js index 685f3ed7..51a6e864 100644 --- a/src/pages/Forms/StepForm/index.js +++ b/src/pages/Forms/StepForm/index.js @@ -1,6 +1,6 @@ import React, { PureComponent, Fragment } from 'react'; import { Card, Steps } from 'antd'; -import PageHeaderLayout from '../../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from '../style.less'; // import { Route, Redirect, Switch } from 'dva/router'; diff --git a/src/pages/List/BasicList.js b/src/pages/List/BasicList.js index 97b8e31a..3e95a1f3 100644 --- a/src/pages/List/BasicList.js +++ b/src/pages/List/BasicList.js @@ -21,8 +21,8 @@ import { Select, } from 'antd'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; -import Result from '../../components/Result'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; +import Result from '@/components/Result'; import styles from './BasicList.less'; diff --git a/src/pages/List/CardList.js b/src/pages/List/CardList.js index 6ad863e5..1426bdec 100644 --- a/src/pages/List/CardList.js +++ b/src/pages/List/CardList.js @@ -3,7 +3,7 @@ import { connect } from 'dva'; import { Card, Button, Icon, List } from 'antd'; import Ellipsis from 'components/Ellipsis'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './CardList.less'; diff --git a/src/pages/List/List.js b/src/pages/List/List.js index 5443f5f6..5e870755 100644 --- a/src/pages/List/List.js +++ b/src/pages/List/List.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { routerRedux } from 'dva/router'; import { connect } from 'dva'; import { Input } from 'antd'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; @connect() export default class SearchList extends Component { diff --git a/src/pages/List/TableList.js b/src/pages/List/TableList.js index 938853ac..fdff5be3 100644 --- a/src/pages/List/TableList.js +++ b/src/pages/List/TableList.js @@ -22,7 +22,7 @@ import { Radio, } from 'antd'; import StandardTable from 'components/StandardTable'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './TableList.less'; diff --git a/src/pages/Profile/AdvancedProfile.js b/src/pages/Profile/AdvancedProfile.js index 93d407f2..03b366e3 100644 --- a/src/pages/Profile/AdvancedProfile.js +++ b/src/pages/Profile/AdvancedProfile.js @@ -19,7 +19,7 @@ import { } from 'antd'; import classNames from 'classnames'; import DescriptionList from 'components/DescriptionList'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './AdvancedProfile.less'; const { Step } = Steps; diff --git a/src/pages/Profile/BasicProfile.js b/src/pages/Profile/BasicProfile.js index b226de39..dd17dad0 100644 --- a/src/pages/Profile/BasicProfile.js +++ b/src/pages/Profile/BasicProfile.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { connect } from 'dva'; import { Card, Badge, Table, Divider } from 'antd'; import DescriptionList from 'components/DescriptionList'; -import PageHeaderLayout from '../../layouts/PageHeaderLayout'; +import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './BasicProfile.less'; const { Description } = DescriptionList; -- GitLab