From 81895705d90878e22f86954040e6baf0cd4789cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=84=9A=E9=81=93?= Date: Thu, 23 Aug 2018 13:50:35 +0800 Subject: [PATCH] use new alias @ which default set in umi --- config/config.js | 12 ++---------- jsconfig.json | 2 +- src/layouts/BasicLayout.js | 6 +++--- src/layouts/Footer.js | 2 +- src/layouts/Header.js | 6 +++--- src/layouts/PageHeaderLayout.js | 2 +- src/layouts/UserLayout.js | 2 +- src/pages/404.js | 2 +- src/pages/Account/Center/Applications.js | 2 +- src/pages/Account/Center/Center.less | 2 +- src/pages/Account/Center/Projects.js | 2 +- src/pages/Account/Settings/BaseView.js | 2 +- src/pages/Account/Settings/SecurityView.js | 10 +++++----- src/pages/Account/Settings/services/geographic.js | 2 +- src/pages/Dashboard/Analysis.js | 6 +++--- src/pages/Dashboard/Analysis.less | 2 +- src/pages/Dashboard/Monitor.js | 8 ++++---- src/pages/Dashboard/Monitor.less | 2 +- src/pages/Dashboard/Workplace.less | 2 +- src/pages/Exception/403.js | 2 +- src/pages/Exception/404.js | 2 +- src/pages/Exception/500.js | 2 +- src/pages/Forms/AdvancedForm.js | 2 +- src/pages/Forms/StepForm/Step2.js | 8 ++------ src/pages/Forms/StepForm/Step3.js | 2 +- src/pages/Forms/StepForm/index.js | 2 +- src/pages/List/Applications.js | 6 +++--- src/pages/List/Applications.less | 2 +- src/pages/List/Articles.js | 4 ++-- src/pages/List/Articles.less | 2 +- src/pages/List/BasicList.less | 2 +- src/pages/List/CardList.js | 2 +- src/pages/List/CardList.less | 2 +- src/pages/List/Projects.js | 8 ++++---- src/pages/List/Projects.less | 2 +- src/pages/List/TableList.js | 2 +- src/pages/List/TableList.less | 2 +- src/pages/Profile/AdvancedProfile.js | 2 +- src/pages/Profile/BasicProfile.js | 2 +- src/pages/Result/Success.js | 2 +- src/pages/User/Login.js | 2 +- src/pages/User/RegisterResult.js | 2 +- src/services/api.js | 2 +- src/services/error.js | 2 +- src/services/user.js | 2 +- src/utils/Authorized.js | 2 +- src/utils/Yuan.js | 2 +- 47 files changed, 68 insertions(+), 80 deletions(-) diff --git a/config/config.js b/config/config.js index d86bc928..d75938ed 100644 --- a/config/config.js +++ b/config/config.js @@ -21,14 +21,12 @@ export default { baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default }, polyfills: ['ie9'], - ...( - (!process.env.TEST && require('os').platform() === 'darwin') + ...(!process.env.TEST && require('os').platform() === 'darwin' ? { dll: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'], hardSource: true, } - : {} - ), + : {}), }, ], ], @@ -42,12 +40,6 @@ export default { '@antv/data-set': 'DataSet', rollbar: 'rollbar', }, - alias: { - components: path.resolve(__dirname, '../src/components/'), - utils: path.resolve(__dirname, '../src/utils/'), - assets: path.resolve(__dirname, '../src/assets/'), - common: path.resolve(__dirname, '../src/common/'), - }, ignoreMomentLocale: true, lessLoaderOptions: { javascriptEnabled: true, diff --git a/jsconfig.json b/jsconfig.json index 5475bee0..f87334d4 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -4,7 +4,7 @@ "experimentalDecorators": true, "baseUrl": ".", "paths": { - "components/*": ["./src/components/*"] + "@/*": ["./src/*"] } } } diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 44e86b17..4f2b9a00 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -8,9 +8,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'; -import Authorized from '../utils/Authorized'; -import SettingDarwer from '../components/SettingDarwer'; +import SiderMenu from '@/components/SiderMenu'; +import Authorized from '@/utils/Authorized'; +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 5c346a52..693c8172 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'; +import GlobalFooter from '@/components/GlobalFooter'; const { Footer } = Layout; const FooterView = () => ( diff --git a/src/layouts/Header.js b/src/layouts/Header.js index afb2c7d0..d297c888 100644 --- a/src/layouts/Header.js +++ b/src/layouts/Header.js @@ -3,10 +3,10 @@ import { Layout, message } from 'antd'; import Animate from 'rc-animate'; import { connect } from 'dva'; import { routerRedux } from 'dva/router'; -import GlobalHeader from '../components/GlobalHeader'; -import TopNavHeader from '../components/TopNavHeader'; +import GlobalHeader from '@/components/GlobalHeader'; +import TopNavHeader from '@/components/TopNavHeader'; import styles from './Header.less'; -import Authorized from '../utils/Authorized'; +import Authorized from '@/utils/Authorized'; const { Header } = Layout; diff --git a/src/layouts/PageHeaderLayout.js b/src/layouts/PageHeaderLayout.js index 8263b18a..eeaac5e0 100644 --- a/src/layouts/PageHeaderLayout.js +++ b/src/layouts/PageHeaderLayout.js @@ -1,7 +1,7 @@ import React from 'react'; import { FormattedMessage } from 'umi/locale'; import { Link } from 'dva/router'; -import PageHeader from 'components/PageHeader'; +import PageHeader from '@/components/PageHeader'; import GridContent from './GridContent'; import styles from './PageHeaderLayout.less'; import MenuContext from './MenuContext'; diff --git a/src/layouts/UserLayout.js b/src/layouts/UserLayout.js index 40eb7ae8..1ff6a42b 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'; +import GlobalFooter from '@/components/GlobalFooter'; import styles from './UserLayout.less'; import logo from '../assets/logo.svg'; diff --git a/src/pages/404.js b/src/pages/404.js index 0a3d8766..a653ef17 100644 --- a/src/pages/404.js +++ b/src/pages/404.js @@ -1,6 +1,6 @@ import React from 'react'; import { Link } from 'dva/router'; -import Exception from 'components/Exception'; +import Exception from '@/components/Exception'; export default () => ( diff --git a/src/pages/Account/Center/Applications.js b/src/pages/Account/Center/Applications.js index 729cdd42..114325bb 100644 --- a/src/pages/Account/Center/Applications.js +++ b/src/pages/Account/Center/Applications.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; import { List, Card, Icon, Dropdown, Menu, Avatar, Tooltip } from 'antd'; import numeral from 'numeral'; import { connect } from 'dva'; -import { formatWan } from '../../../utils/utils'; +import { formatWan } from '@/utils/utils'; import stylesApplications from '../../List/Applications.less'; @connect(({ list }) => ({ diff --git a/src/pages/Account/Center/Center.less b/src/pages/Account/Center/Center.less index 727b9021..37d6a203 100644 --- a/src/pages/Account/Center/Center.less +++ b/src/pages/Account/Center/Center.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../../utils/utils.less'; +@import '~@/utils/utils.less'; .avatarHolder { text-align: center; diff --git a/src/pages/Account/Center/Projects.js b/src/pages/Account/Center/Projects.js index 7eb91be8..74af5e16 100644 --- a/src/pages/Account/Center/Projects.js +++ b/src/pages/Account/Center/Projects.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; import { List, Card } from 'antd'; import moment from 'moment'; import { connect } from 'dva'; -import AvatarList from '../../../components/AvatarList'; +import AvatarList from '@/components/AvatarList'; import stylesProjects from '../../List/Projects.less'; @connect(({ list }) => ({ diff --git a/src/pages/Account/Settings/BaseView.js b/src/pages/Account/Settings/BaseView.js index 32721e14..727fd9c3 100644 --- a/src/pages/Account/Settings/BaseView.js +++ b/src/pages/Account/Settings/BaseView.js @@ -5,7 +5,7 @@ import { connect } from 'dva'; import styles from './BaseView.less'; import GeographicView from './GeographicView'; import PhoneView from './PhoneView'; -// import { getTimeDistance } from '../../../utils/utils'; +// import { getTimeDistance } from '@/utils/utils'; const FormItem = Form.Item; const { Option } = Select; diff --git a/src/pages/Account/Settings/SecurityView.js b/src/pages/Account/Settings/SecurityView.js index 687d63e8..a58766b3 100644 --- a/src/pages/Account/Settings/SecurityView.js +++ b/src/pages/Account/Settings/SecurityView.js @@ -1,7 +1,7 @@ import React, { Component, Fragment } from 'react'; import { formatMessage, FormattedMessage } from 'umi/locale'; import { List } from 'antd'; -// import { getTimeDistance } from '../../../utils/utils'; +// import { getTimeDistance } from '@/utils/utils'; const passwordStrength = { strong: ( @@ -16,7 +16,8 @@ const passwordStrength = { ), weak: ( - Weak + + Weak ), }; @@ -28,9 +29,8 @@ class SecurityView extends Component { title: formatMessage({ id: 'app.settings.security.password' }, {}), description: ( - {formatMessage({ id: 'app.settings.security.password-description' }, {})}:{ - passwordStrength.strong - } + {formatMessage({ id: 'app.settings.security.password-description' }, {})}: + {passwordStrength.strong} ), actions: [ diff --git a/src/pages/Account/Settings/services/geographic.js b/src/pages/Account/Settings/services/geographic.js index ee7fcc3f..a5defd87 100644 --- a/src/pages/Account/Settings/services/geographic.js +++ b/src/pages/Account/Settings/services/geographic.js @@ -1,4 +1,4 @@ -import request from '../../../../utils/request'; +import request from '@/utils/request'; export async function queryProvince() { return request('/api/geographic/province'); diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index 5f3b37f0..62679aa8 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -23,9 +23,9 @@ import { Bar, Pie, TimelineChart, -} from 'components/Charts'; -import Trend from 'components/Trend'; -import NumberInfo from 'components/NumberInfo'; +} from '@/components/Charts'; +import Trend from '@/components/Trend'; +import NumberInfo from '@/components/NumberInfo'; import numeral from 'numeral'; import GridContent from '@/layouts/GridContent'; import Yuan from '@/utils/Yuan'; diff --git a/src/pages/Dashboard/Analysis.less b/src/pages/Dashboard/Analysis.less index dc2319cb..8f3eb388 100644 --- a/src/pages/Dashboard/Analysis.less +++ b/src/pages/Dashboard/Analysis.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .iconGroup { i { diff --git a/src/pages/Dashboard/Monitor.js b/src/pages/Dashboard/Monitor.js index 54b3970e..c6b5463f 100644 --- a/src/pages/Dashboard/Monitor.js +++ b/src/pages/Dashboard/Monitor.js @@ -1,10 +1,10 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; import { Row, Col, Card, Tooltip } from 'antd'; -import { Pie, WaterWave, Gauge, TagCloud } from 'components/Charts'; -import NumberInfo from 'components/NumberInfo'; -import CountDown from 'components/CountDown'; -import ActiveChart from 'components/ActiveChart'; +import { Pie, WaterWave, Gauge, TagCloud } from '@/components/Charts'; +import NumberInfo from '@/components/NumberInfo'; +import CountDown from '@/components/CountDown'; +import ActiveChart from '@/components/ActiveChart'; import numeral from 'numeral'; import GridContent from '@/layouts/GridContent'; diff --git a/src/pages/Dashboard/Monitor.less b/src/pages/Dashboard/Monitor.less index 3f0701f1..0316b619 100644 --- a/src/pages/Dashboard/Monitor.less +++ b/src/pages/Dashboard/Monitor.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .mapChart { padding-top: 24px; diff --git a/src/pages/Dashboard/Workplace.less b/src/pages/Dashboard/Workplace.less index 4bd4979b..03801711 100644 --- a/src/pages/Dashboard/Workplace.less +++ b/src/pages/Dashboard/Workplace.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .activitiesList { padding: 0 24px 8px 24px; diff --git a/src/pages/Exception/403.js b/src/pages/Exception/403.js index 84ee0fdc..c75724aa 100644 --- a/src/pages/Exception/403.js +++ b/src/pages/Exception/403.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { formatMessage } from 'umi/locale'; import { Link } from 'dva/router'; -import Exception from 'components/Exception'; +import Exception from '@/components/Exception'; class Exception403 extends Component { render() { diff --git a/src/pages/Exception/404.js b/src/pages/Exception/404.js index ebec5032..e9ecdff1 100644 --- a/src/pages/Exception/404.js +++ b/src/pages/Exception/404.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { formatMessage } from 'umi/locale'; import { Link } from 'dva/router'; -import Exception from 'components/Exception'; +import Exception from '@/components/Exception'; class Exception404 extends Component { render() { diff --git a/src/pages/Exception/500.js b/src/pages/Exception/500.js index e7b36ae0..f85732e4 100644 --- a/src/pages/Exception/500.js +++ b/src/pages/Exception/500.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { formatMessage } from 'umi/locale'; import { Link } from 'dva/router'; -import Exception from 'components/Exception'; +import Exception from '@/components/Exception'; class Exception500 extends Component { render() { diff --git a/src/pages/Forms/AdvancedForm.js b/src/pages/Forms/AdvancedForm.js index 3d20badc..a7e7c289 100644 --- a/src/pages/Forms/AdvancedForm.js +++ b/src/pages/Forms/AdvancedForm.js @@ -13,7 +13,7 @@ import { Popover, } from 'antd'; import { connect } from 'dva'; -import FooterToolbar from 'components/FooterToolbar'; +import FooterToolbar from '@/components/FooterToolbar'; import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import TableForm from './TableForm'; import styles from './style.less'; diff --git a/src/pages/Forms/StepForm/Step2.js b/src/pages/Forms/StepForm/Step2.js index 54fe43c1..856ba7ee 100644 --- a/src/pages/Forms/StepForm/Step2.js +++ b/src/pages/Forms/StepForm/Step2.js @@ -2,7 +2,7 @@ import React from 'react'; import { connect } from 'dva'; import { Form, Input, Button, Alert, Divider } from 'antd'; import { routerRedux } from 'dva/router'; -import { digitUppercase } from '../../../utils/utils'; +import { digitUppercase } from '@/utils/utils'; import styles from './style.less'; const formItemLayout = { @@ -55,11 +55,7 @@ class Step2 extends React.PureComponent { {data.amount} - - ( - {digitUppercase(data.amount)} - ) - + ({digitUppercase(data.amount)}) diff --git a/src/pages/Forms/StepForm/Step3.js b/src/pages/Forms/StepForm/Step3.js index 2438d82e..6b29dba1 100644 --- a/src/pages/Forms/StepForm/Step3.js +++ b/src/pages/Forms/StepForm/Step3.js @@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; import { connect } from 'dva'; import { Button, Row, Col } from 'antd'; import { routerRedux } from 'dva/router'; -import Result from 'components/Result'; +import Result from '@/components/Result'; import styles from './style.less'; @connect(({ form }) => ({ diff --git a/src/pages/Forms/StepForm/index.js b/src/pages/Forms/StepForm/index.js index 51a6e864..8ea12024 100644 --- a/src/pages/Forms/StepForm/index.js +++ b/src/pages/Forms/StepForm/index.js @@ -4,7 +4,7 @@ import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from '../style.less'; // import { Route, Redirect, Switch } from 'dva/router'; -// import { getRoutes } from '../../../utils/utils'; +// import { getRoutes } from '@/utils/utils'; const { Step } = Steps; diff --git a/src/pages/List/Applications.js b/src/pages/List/Applications.js index 1503c6f4..9bf1e42c 100644 --- a/src/pages/List/Applications.js +++ b/src/pages/List/Applications.js @@ -2,10 +2,10 @@ import React, { PureComponent } from 'react'; import numeral from 'numeral'; import { connect } from 'dva'; import { Row, Col, Form, Card, Select, Icon, Avatar, List, Tooltip, Dropdown, Menu } from 'antd'; -import TagSelect from 'components/TagSelect'; -import StandardFormRow from 'components/StandardFormRow'; +import TagSelect from '@/components/TagSelect'; +import StandardFormRow from '@/components/StandardFormRow'; -import { formatWan } from '../../utils/utils'; +import { formatWan } from '@/utils/utils'; import styles from './Applications.less'; diff --git a/src/pages/List/Applications.less b/src/pages/List/Applications.less index ba6cfa79..8f5cb368 100644 --- a/src/pages/List/Applications.less +++ b/src/pages/List/Applications.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .filterCardList { margin-bottom: -24px; diff --git a/src/pages/List/Articles.js b/src/pages/List/Articles.js index bca8f10b..9e90d02b 100644 --- a/src/pages/List/Articles.js +++ b/src/pages/List/Articles.js @@ -3,8 +3,8 @@ import moment from 'moment'; import { connect } from 'dva'; import { Form, Card, Select, List, Tag, Icon, Avatar, Row, Col, Button } from 'antd'; -import TagSelect from 'components/TagSelect'; -import StandardFormRow from 'components/StandardFormRow'; +import TagSelect from '@/components/TagSelect'; +import StandardFormRow from '@/components/StandardFormRow'; import styles from './Articles.less'; const { Option } = Select; diff --git a/src/pages/List/Articles.less b/src/pages/List/Articles.less index 364063a3..3f2db2b2 100644 --- a/src/pages/List/Articles.less +++ b/src/pages/List/Articles.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .listContent { .description { diff --git a/src/pages/List/BasicList.less b/src/pages/List/BasicList.less index 29cb62d4..f086c501 100644 --- a/src/pages/List/BasicList.less +++ b/src/pages/List/BasicList.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .standardList { :global { diff --git a/src/pages/List/CardList.js b/src/pages/List/CardList.js index 1426bdec..2c6c8baa 100644 --- a/src/pages/List/CardList.js +++ b/src/pages/List/CardList.js @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; import { Card, Button, Icon, List } from 'antd'; -import Ellipsis from 'components/Ellipsis'; +import Ellipsis from '@/components/Ellipsis'; import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './CardList.less'; diff --git a/src/pages/List/CardList.less b/src/pages/List/CardList.less index cbab2cd3..3d6feacc 100644 --- a/src/pages/List/CardList.less +++ b/src/pages/List/CardList.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .cardList { margin-bottom: -24px; diff --git a/src/pages/List/Projects.js b/src/pages/List/Projects.js index 4775640a..1b04eb62 100644 --- a/src/pages/List/Projects.js +++ b/src/pages/List/Projects.js @@ -3,10 +3,10 @@ import moment from 'moment'; import { connect } from 'dva'; import { Row, Col, Form, Card, Select, List } from 'antd'; -import TagSelect from 'components/TagSelect'; -import AvatarList from 'components/AvatarList'; -import Ellipsis from 'components/Ellipsis'; -import StandardFormRow from 'components/StandardFormRow'; +import TagSelect from '@/components/TagSelect'; +import AvatarList from '@/components/AvatarList'; +import Ellipsis from '@/components/Ellipsis'; +import StandardFormRow from '@/components/StandardFormRow'; import styles from './Projects.less'; diff --git a/src/pages/List/Projects.less b/src/pages/List/Projects.less index aeda83c1..43b8d726 100644 --- a/src/pages/List/Projects.less +++ b/src/pages/List/Projects.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .coverCardList { margin-bottom: -24px; diff --git a/src/pages/List/TableList.js b/src/pages/List/TableList.js index fdff5be3..531fc7c7 100644 --- a/src/pages/List/TableList.js +++ b/src/pages/List/TableList.js @@ -21,7 +21,7 @@ import { Steps, Radio, } from 'antd'; -import StandardTable from 'components/StandardTable'; +import StandardTable from '@/components/StandardTable'; import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './TableList.less'; diff --git a/src/pages/List/TableList.less b/src/pages/List/TableList.less index f3d627ea..792757df 100644 --- a/src/pages/List/TableList.less +++ b/src/pages/List/TableList.less @@ -1,5 +1,5 @@ @import '~antd/lib/style/themes/default.less'; -@import '../../utils/utils.less'; +@import '~@/utils/utils.less'; .tableList { .tableListOperator { diff --git a/src/pages/Profile/AdvancedProfile.js b/src/pages/Profile/AdvancedProfile.js index 03b366e3..37dfbefb 100644 --- a/src/pages/Profile/AdvancedProfile.js +++ b/src/pages/Profile/AdvancedProfile.js @@ -18,7 +18,7 @@ import { Divider, } from 'antd'; import classNames from 'classnames'; -import DescriptionList from 'components/DescriptionList'; +import DescriptionList from '@/components/DescriptionList'; import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './AdvancedProfile.less'; diff --git a/src/pages/Profile/BasicProfile.js b/src/pages/Profile/BasicProfile.js index dd17dad0..ea457288 100644 --- a/src/pages/Profile/BasicProfile.js +++ b/src/pages/Profile/BasicProfile.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { connect } from 'dva'; import { Card, Badge, Table, Divider } from 'antd'; -import DescriptionList from 'components/DescriptionList'; +import DescriptionList from '@/components/DescriptionList'; import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import styles from './BasicProfile.less'; diff --git a/src/pages/Result/Success.js b/src/pages/Result/Success.js index 1d049b8f..12e38452 100644 --- a/src/pages/Result/Success.js +++ b/src/pages/Result/Success.js @@ -1,7 +1,7 @@ import React, { Fragment } from 'react'; import { formatMessage, FormattedMessage } from 'umi/locale'; import { Button, Row, Col, Icon, Steps, Card } from 'antd'; -import Result from 'components/Result'; +import Result from '@/components/Result'; import PageHeaderLayout from '@/layouts/PageHeaderLayout'; const { Step } = Steps; diff --git a/src/pages/User/Login.js b/src/pages/User/Login.js index a88a5ae4..46278402 100644 --- a/src/pages/User/Login.js +++ b/src/pages/User/Login.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { connect } from 'dva'; import { Link } from 'dva/router'; import { Checkbox, Alert, Icon } from 'antd'; -import Login from 'components/Login'; +import Login from '@/components/Login'; import styles from './Login.less'; const { Tab, UserName, Password, Mobile, Captcha, Submit } = Login; diff --git a/src/pages/User/RegisterResult.js b/src/pages/User/RegisterResult.js index fac8260b..28eca745 100644 --- a/src/pages/User/RegisterResult.js +++ b/src/pages/User/RegisterResult.js @@ -1,7 +1,7 @@ import React from 'react'; import { Button } from 'antd'; import { Link } from 'dva/router'; -import Result from 'components/Result'; +import Result from '@/components/Result'; import styles from './RegisterResult.less'; const actions = ( diff --git a/src/services/api.js b/src/services/api.js index 2281cd34..431f2ccd 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -1,5 +1,5 @@ import { stringify } from 'qs'; -import request from '../utils/request'; +import request from '@/utils/request'; export async function queryProjectNotice() { return request('/api/project/notice'); diff --git a/src/services/error.js b/src/services/error.js index 7e1eeee1..b77e4de9 100644 --- a/src/services/error.js +++ b/src/services/error.js @@ -1,4 +1,4 @@ -import request from '../utils/request'; +import request from '@/utils/request'; export async function query(code) { return request(`/api/${code}`); diff --git a/src/services/user.js b/src/services/user.js index c4defb4f..89e03c6f 100644 --- a/src/services/user.js +++ b/src/services/user.js @@ -1,4 +1,4 @@ -import request from '../utils/request'; +import request from '@/utils/request'; export async function query() { return request('/api/users'); diff --git a/src/utils/Authorized.js b/src/utils/Authorized.js index ceb11617..8c420cba 100644 --- a/src/utils/Authorized.js +++ b/src/utils/Authorized.js @@ -1,4 +1,4 @@ -import RenderAuthorized from '../components/Authorized'; +import RenderAuthorized from '@/components/Authorized'; import { getAuthority } from './authority'; let Authorized = RenderAuthorized(getAuthority()); // eslint-disable-line diff --git a/src/utils/Yuan.js b/src/utils/Yuan.js index f5436b42..434a57fb 100644 --- a/src/utils/Yuan.js +++ b/src/utils/Yuan.js @@ -1,5 +1,5 @@ import React from 'react'; -import { yuan } from 'components/Charts'; +import { yuan } from '@/components/Charts'; /** * 减少使用 dangerouslySetInnerHTML */ -- GitLab