Commit ac17ede7 authored by 陈帅's avatar 陈帅

AccountSettings is finsh

parent a037aca0
export default {
plugins: [
['umi-plugin-block-dev', { layout: 'ant-design-pro' }],
[
'umi-plugin-react',
{
dva: true,
locale: true,
antd: true,
},
],
],
};
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
call, call,
put, put,
}: { }: {
call: callType<Function, [], Promise<any>>; call: callType<Function, [], ReturnType<typeof queryCurrent>>;
put: Dispatch; put: Dispatch;
} }
) { ) {
......
export default {
plugins: [
[
'umi-plugin-block-dev',
{
layout: 'ant-design-pro',
},
],
[
'umi-plugin-react',
{
dva: true,
locale: true,
antd: true,
},
],
],
};
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
import city from './geographic/city.json'; import city from './geographic/city.json';
import province from './geographic/province.json'; import province from './geographic/province.json';
function getProvince(req, res) { function getProvince(req: any, res: { json: (arg0: { name: string; id: string }[]) => void }) {
return res.json(province); return res.json(province);
} }
function getCity(req, res) { function getCity(
req: { params: { province: string | number } },
res: { json: (arg: any) => void }
) {
return res.json(city[req.params.province]); return res.json(city[req.params.province]);
} }
// 代码中会兼容本地 service mock 以及部署站点的静态数据 // 代码中会兼容本地 service mock 以及部署站点的静态数据
......
import React, { PureComponent } from 'react'; import React, { Component } from 'react';
import { Select, Spin } from 'antd'; import { Select, Spin } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import styles from './GeographicView.less'; import styles from './GeographicView.less';
import { Dispatch } from 'redux';
import { ProvinceData, CityData } from '../data';
const { Option } = Select; const { Option } = Select;
const nullSlectItem = { interface SelectItem {
label: string;
key: string;
}
const nullSlectItem: SelectItem = {
label: '', label: '',
key: '', key: '',
}; };
@connect(({ BLOCK_NAME_CAMEL_CASE, loading }) => { interface GeographicViewProps {
dispatch?: Dispatch;
province?: ProvinceData[];
city?: CityData[];
value?: {
province: SelectItem;
city: SelectItem;
};
loading?: boolean;
onChange?: (value: { province: SelectItem; city: SelectItem }) => void;
}
@connect(
({
BLOCK_NAME_CAMEL_CASE,
loading,
}: {
BLOCK_NAME_CAMEL_CASE: {
province: ProvinceData[];
city: CityData[];
};
loading: any;
}) => {
const { province, city } = BLOCK_NAME_CAMEL_CASE; const { province, city } = BLOCK_NAME_CAMEL_CASE;
return { return {
province, province,
city, city,
loading: loading.models.BLOCK_NAME_CAMEL_CASE, loading: loading.models.BLOCK_NAME_CAMEL_CASE,
}; };
}) }
class GeographicView extends PureComponent { )
class GeographicView extends Component<GeographicViewProps> {
componentDidMount = () => { componentDidMount = () => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch &&
dispatch({ dispatch({
type: 'BLOCK_NAME_CAMEL_CASE/fetchProvince', type: 'BLOCK_NAME_CAMEL_CASE/fetchProvince',
}); });
}; };
componentDidUpdate(props) { componentDidUpdate(props: GeographicViewProps) {
const { dispatch, value } = this.props; const { dispatch, value } = this.props;
if (!props.value && !!value && !!value.province) { if (!props.value && !!value && !!value.province) {
dispatch &&
dispatch({ dispatch({
type: 'BLOCK_NAME_CAMEL_CASE/fetchCity', type: 'BLOCK_NAME_CAMEL_CASE/fetchCity',
payload: value.province.key, payload: value.province.key,
...@@ -39,15 +69,21 @@ class GeographicView extends PureComponent { ...@@ -39,15 +69,21 @@ class GeographicView extends PureComponent {
getProvinceOption() { getProvinceOption() {
const { province } = this.props; const { province } = this.props;
if (province) {
return this.getOption(province); return this.getOption(province);
} }
return [];
}
getCityOption = () => { getCityOption = () => {
const { city } = this.props; const { city } = this.props;
if (city) {
return this.getOption(city); return this.getOption(city);
}
return [];
}; };
getOption = list => { getOption = (list: CityData[] | ProvinceData[]) => {
if (!list || list.length < 1) { if (!list || list.length < 1) {
return ( return (
<Option key={0} value={0}> <Option key={0} value={0}>
...@@ -55,31 +91,37 @@ class GeographicView extends PureComponent { ...@@ -55,31 +91,37 @@ class GeographicView extends PureComponent {
</Option> </Option>
); );
} }
return list.map(item => ( return (list as CityData[]).map(item => (
<Option key={item.id} value={item.id}> <Option key={item.id} value={item.id}>
{item.name} {item.name}
</Option> </Option>
)); ));
}; };
selectProvinceItem = item => { selectProvinceItem = (item: SelectItem) => {
const { dispatch, onChange } = this.props; const { dispatch, onChange } = this.props;
dispatch &&
dispatch({ dispatch({
type: 'BLOCK_NAME_CAMEL_CASE/fetchCity', type: 'BLOCK_NAME_CAMEL_CASE/fetchCity',
payload: item.key, payload: item.key,
}); });
onChange &&
onChange({ onChange({
province: item, province: item,
city: nullSlectItem, city: nullSlectItem,
}); });
}; };
selectCityItem = item => { selectCityItem = (item: SelectItem) => {
const { value, onChange } = this.props; const { value, onChange } = this.props;
if (value && onChange) {
onChange({ onChange({
province: value.province, province: value.province,
city: item, city: item,
}); });
}
}; };
conversionObject() { conversionObject() {
......
...@@ -2,7 +2,12 @@ import React, { Fragment, PureComponent } from 'react'; ...@@ -2,7 +2,12 @@ import React, { Fragment, PureComponent } from 'react';
import { Input } from 'antd'; import { Input } from 'antd';
import styles from './PhoneView.less'; import styles from './PhoneView.less';
class PhoneView extends PureComponent { interface PhoneViewProps {
value?: string;
onChange?: (value: string) => void;
}
class PhoneView extends PureComponent<PhoneViewProps> {
render() { render() {
const { value, onChange } = this.props; const { value, onChange } = this.props;
let values = ['', '']; let values = ['', ''];
...@@ -15,13 +20,13 @@ class PhoneView extends PureComponent { ...@@ -15,13 +20,13 @@ class PhoneView extends PureComponent {
className={styles.area_code} className={styles.area_code}
value={values[0]} value={values[0]}
onChange={e => { onChange={e => {
onChange(`${e.target.value}-${values[1]}`); onChange && onChange(`${e.target.value}-${values[1]}`);
}} }}
/> />
<Input <Input
className={styles.phone_number} className={styles.phone_number}
onChange={e => { onChange={e => {
onChange(`${values[0]}-${e.target.value}`); onChange && onChange(`${values[0]}-${e.target.value}`);
}} }}
value={values[1]} value={values[1]}
/> />
......
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { Form, Input, Upload, Select, Button } from 'antd'; import { Form, Input, Upload, Select, Button } from 'antd';
import { FormComponentProps } from 'antd/lib/form';
import { connect } from 'dva'; import { connect } from 'dva';
import styles from './BaseView.less'; import styles from './BaseView.less';
import GeographicView from './GeographicView'; import GeographicView from './GeographicView';
import PhoneView from './PhoneView'; import PhoneView from './PhoneView';
import { CurrentUser } from '../data';
const FormItem = Form.Item; const FormItem = Form.Item;
const { Option } = Select; const { Option } = Select;
// 头像组件 方便以后独立,增加裁剪之类的功能 // 头像组件 方便以后独立,增加裁剪之类的功能
const AvatarView = ({ avatar }) => ( const AvatarView = ({ avatar }: { avatar: string }) => (
<Fragment> <Fragment>
<div className={styles.avatar_title}> <div className={styles.avatar_title}>
<FormattedMessage id="BLOCK_NAME.basic.avatar" defaultMessage="Avatar" /> <FormattedMessage id="BLOCK_NAME.basic.avatar" defaultMessage="Avatar" />
...@@ -27,8 +28,19 @@ const AvatarView = ({ avatar }) => ( ...@@ -27,8 +28,19 @@ const AvatarView = ({ avatar }) => (
</Upload> </Upload>
</Fragment> </Fragment>
); );
interface SelectItem {
label: string;
key: string;
}
const validatorGeographic = (rule, value, callback) => { const validatorGeographic = (
_: any,
value: {
province: SelectItem;
city: SelectItem;
},
callback: (message?: string) => void
) => {
const { province, city } = value; const { province, city } = value;
if (!province.key) { if (!province.key) {
callback('Please input your province!'); callback('Please input your province!');
...@@ -39,7 +51,7 @@ const validatorGeographic = (rule, value, callback) => { ...@@ -39,7 +51,7 @@ const validatorGeographic = (rule, value, callback) => {
callback(); callback();
}; };
const validatorPhone = (rule, value, callback) => { const validatorPhone = (rule: any, value: string, callback: (message?: string) => void) => {
const values = value.split('-'); const values = value.split('-');
if (!values[0]) { if (!values[0]) {
callback('Please input your area code!'); callback('Please input your area code!');
...@@ -50,11 +62,14 @@ const validatorPhone = (rule, value, callback) => { ...@@ -50,11 +62,14 @@ const validatorPhone = (rule, value, callback) => {
callback(); callback();
}; };
@connect(({ BLOCK_NAME_CAMEL_CASE }) => ({ interface BaseViewProps extends FormComponentProps {
currentUser: CurrentUser;
}
@connect(({ BLOCK_NAME_CAMEL_CASE }: { BLOCK_NAME_CAMEL_CASE: { currentUser: CurrentUser } }) => ({
currentUser: BLOCK_NAME_CAMEL_CASE.currentUser, currentUser: BLOCK_NAME_CAMEL_CASE.currentUser,
})) }))
@Form.create() class BaseView extends Component<BaseViewProps> {
class BaseView extends Component {
componentDidMount() { componentDidMount() {
this.setBaseInfo(); this.setBaseInfo();
} }
...@@ -76,8 +91,9 @@ class BaseView extends Component { ...@@ -76,8 +91,9 @@ class BaseView extends Component {
const url = 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'; const url = 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png';
return url; return url;
} }
view: HTMLDivElement | undefined;
getViewDom = ref => { getViewDom = (ref: HTMLDivElement) => {
this.view = ref; this.view = ref;
}; };
...@@ -88,7 +104,7 @@ class BaseView extends Component { ...@@ -88,7 +104,7 @@ class BaseView extends Component {
return ( return (
<div className={styles.baseView} ref={this.getViewDom}> <div className={styles.baseView} ref={this.getViewDom}>
<div className={styles.left}> <div className={styles.left}>
<Form layout="vertical" onSubmit={this.handleSubmit} hideRequiredMark> <Form layout="vertical" hideRequiredMark>
<FormItem label={formatMessage({ id: 'BLOCK_NAME.basic.email' })}> <FormItem label={formatMessage({ id: 'BLOCK_NAME.basic.email' })}>
{getFieldDecorator('email', { {getFieldDecorator('email', {
rules: [ rules: [
...@@ -185,4 +201,4 @@ class BaseView extends Component { ...@@ -185,4 +201,4 @@ class BaseView extends Component {
} }
} }
export default BaseView; export default Form.create()(BaseView);
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { Icon, List } from 'antd'; import { Icon, List } from 'antd';
class BindingView extends Component { class BindingView extends Component {
......
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi-plugin-react/locale';
import { Switch, List } from 'antd'; import { Switch, List } from 'antd';
type Unpacked<T> = T extends (infer U)[] ? U : T;
class NotificationView extends Component { class NotificationView extends Component {
getData = () => { getData = () => {
const Action = ( const Action = (
...@@ -31,11 +33,12 @@ class NotificationView extends Component { ...@@ -31,11 +33,12 @@ class NotificationView extends Component {
}; };
render() { render() {
const data = this.getData();
return ( return (
<Fragment> <Fragment>
<List <List<Unpacked<typeof data>>
itemLayout="horizontal" itemLayout="horizontal"
dataSource={this.getData()} dataSource={data}
renderItem={item => ( renderItem={item => (
<List.Item actions={item.actions}> <List.Item actions={item.actions}>
<List.Item.Meta title={item.title} description={item.description} /> <List.Item.Meta title={item.title} description={item.description} />
......
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { List } from 'antd'; import { List } from 'antd';
// import { getTimeDistance } from '@/utils/utils';
type Unpacked<T> = T extends (infer U)[] ? U : T;
const passwordStrength = { const passwordStrength = {
strong: ( strong: (
<font className="strong"> <span className="strong">
<FormattedMessage id="BLOCK_NAME.security.strong" defaultMessage="Strong" /> <FormattedMessage id="BLOCK_NAME.security.strong" defaultMessage="Strong" />
</font> </span>
), ),
medium: ( medium: (
<font className="medium"> <span className="medium">
<FormattedMessage id="BLOCK_NAME.security.medium" defaultMessage="Medium" /> <FormattedMessage id="BLOCK_NAME.security.medium" defaultMessage="Medium" />
</font> </span>
), ),
weak: ( weak: (
<font className="weak"> <span className="weak">
<FormattedMessage id="BLOCK_NAME.security.weak" defaultMessage="Weak" /> <FormattedMessage id="BLOCK_NAME.security.weak" defaultMessage="Weak" />
Weak Weak
</font> </span>
), ),
}; };
...@@ -83,11 +84,12 @@ class SecurityView extends Component { ...@@ -83,11 +84,12 @@ class SecurityView extends Component {
]; ];
render() { render() {
const data = this.getData();
return ( return (
<Fragment> <Fragment>
<List <List<Unpacked<typeof data>>
itemLayout="horizontal" itemLayout="horizontal"
dataSource={this.getData()} dataSource={data}
renderItem={item => ( renderItem={item => (
<List.Item actions={item.actions}> <List.Item actions={item.actions}>
<List.Item.Meta title={item.title} description={item.description} /> <List.Item.Meta title={item.title} description={item.description} />
......
export interface ITag {
key: string;
label: string;
}
export interface Province {
label: string;
key: string;
}
export interface City {
label: string;
key: string;
}
export interface Geographic {
province: Province;
city: City;
}
export interface ProvinceData {
name: string;
id: string;
}
export interface CityData {
province: string;
name: string;
id: string;
}
export interface Notice {
id: string;
title: string;
logo: string;
description: string;
updatedAt: string;
member: string;
href: string;
memberLink: string;
}
export interface CurrentUser {
name: string;
avatar: string;
userid: string;
notice: Notice[];
email: string;
signature: string;
title: string;
group: string;
tags: ITag[];
notifyCount: number;
unreadCount: number;
country: string;
geographic: Geographic;
address: string;
phone: string;
}
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import { Menu } from 'antd'; import { Menu } from 'antd';
import styles from './style.less'; import styles from './style.less';
import BaseView from './components/base'; import BaseView from './components/base';
......
...@@ -8,7 +8,7 @@ export async function queryProvince() { ...@@ -8,7 +8,7 @@ export async function queryProvince() {
return request('/api/BLOCK_NAME/province'); return request('/api/BLOCK_NAME/province');
} }
export async function queryCity(province) { export async function queryCity(province: string) {
return request(`/api/BLOCK_NAME/city/${province}`); return request(`/api/BLOCK_NAME/city/${province}`);
} }
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React, { memo } from 'react'; import React, { memo } from 'react';
import { Row, Col, Icon, Tooltip } from 'antd'; import { Row, Col, Icon, Tooltip } from 'antd';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import { Charts, Trend } from 'ant-design-pro'; import { Charts, Trend } from 'ant-design-pro';
import numeral from 'numeral'; import numeral from 'numeral';
import styles from '../style.less'; import styles from '../style.less';
......
import React, { memo } from 'react'; import React, { memo } from 'react';
import { Card, Tabs, Row, Col } from 'antd'; import { Card, Tabs, Row, Col } from 'antd';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { Charts, NumberInfo } from 'ant-design-pro'; import { Charts, NumberInfo } from 'ant-design-pro';
import styles from '../style.less'; import styles from '../style.less';
......
import React, { memo } from 'react'; import React, { memo } from 'react';
import { Card, Radio } from 'antd'; import { Card, Radio } from 'antd';
import { Charts } from 'ant-design-pro'; import { Charts } from 'ant-design-pro';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import styles from '../style.less'; import styles from '../style.less';
import Yuan from '../utils/Yuan'; import Yuan from '../utils/Yuan';
......
import React, { memo } from 'react'; import React, { memo } from 'react';
import { Row, Col, Card, Tabs, DatePicker } from 'antd'; import { Row, Col, Card, Tabs, DatePicker } from 'antd';
import { FormattedMessage, formatMessage } from 'umi/locale'; import { FormattedMessage, formatMessage } from 'umi-plugin-react/locale';
import numeral from 'numeral'; import numeral from 'numeral';
import { Charts } from 'ant-design-pro'; import { Charts } from 'ant-design-pro';
import styles from '../style.less'; import styles from '../style.less';
......
import React, { memo } from 'react'; import React, { memo } from 'react';
import { Row, Col, Table, Tooltip, Card, Icon } from 'antd'; import { Row, Col, Table, Tooltip, Card, Icon } from 'antd';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import { Trend, NumberInfo, Charts } from 'ant-design-pro'; import { Trend, NumberInfo, Charts } from 'ant-design-pro';
import numeral from 'numeral'; import numeral from 'numeral';
import styles from '../style.less'; import styles from '../style.less';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { import {
Form, Form,
Input, Input,
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import { findDOMNode } from 'react-dom'; import { findDOMNode } from 'react-dom';
import moment from 'moment'; import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { Row, Col, Card, Tooltip } from 'antd'; import { Row, Col, Card, Tooltip } from 'antd';
import { NumberInfo, Charts } from 'ant-design-pro'; import { NumberInfo, Charts } from 'ant-design-pro';
import CountDown from 'ant-design-pro/lib/CountDown'; import CountDown from 'ant-design-pro/lib/CountDown';
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { Button, Icon, Card } from 'antd'; import { Button, Icon, Card } from 'antd';
import { Result } from 'ant-design-pro'; import { Result } from 'ant-design-pro';
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { Button, Row, Col, Icon, Steps, Card } from 'antd'; import { Button, Row, Col, Icon, Steps, Card } from 'antd';
import { Result } from 'ant-design-pro'; import { Result } from 'ant-design-pro';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { Checkbox, Alert, Icon } from 'antd'; import { Checkbox, Alert, Icon } from 'antd';
import { Login } from 'ant-design-pro'; import { Login } from 'ant-design-pro';
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import router from 'umi/router'; import router from 'umi/router';
import { Form, Input, Button, Select, Row, Col, Popover, Progress } from 'antd'; import { Form, Input, Button, Select, Row, Col, Popover, Progress } from 'antd';
......
import React from 'react'; import React from 'react';
import { formatMessage, FormattedMessage } from 'umi/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { Button } from 'antd'; import { Button } from 'antd';
import Link from 'umi/link'; import Link from 'umi/link';
import { Result } from 'ant-design-pro'; import { Result } from 'ant-design-pro';
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi-plugin-react/locale';
import Link from 'umi/link'; import Link from 'umi/link';
import { PageHeader } from 'ant-design-pro'; import { PageHeader } from 'ant-design-pro';
import styles from './index.less'; import styles from './index.less';
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"suppressImplicitAnyIndexErrors": true, "suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"allowJs": true, "allowJs": true,
"resolveJsonModule": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"strict": true, "strict": true,
"paths": { "paths": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment