Commit e7a78e7d authored by 陈帅's avatar 陈帅

bugfix: fix trigger error

parent b1ef8d42
......@@ -41,7 +41,6 @@ export default {
{ path: '/user/register-result', component: './User/RegisterResult' },
],
},
// app
{
path: '/',
......@@ -125,14 +124,10 @@ export default {
},
],
// https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
theme: {
// 'primary-color': '#10e99b',
'card-actions-background': '#f5f8fa',
},
// copy from old webpackrc.js
// entry: 'src/index.js', // TODO remove
extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]],
env: {
......@@ -152,10 +147,6 @@ export default {
common: path.resolve(__dirname, '../src/common/'),
},
ignoreMomentLocale: true,
// theme: './theme.js',
// html: { TODO remove
// template: './index.ejs',
// },
publicPath: '/',
// TODO check hash config
// hash: true,
......
......@@ -330,26 +330,6 @@ const menuData = [
},
],
},
{
name: 'user',
icon: 'user',
path: 'User',
authority: 'guest',
children: [
{
name: 'login',
path: 'login',
},
{
name: 'register',
path: 'register',
},
{
name: 'register-result',
path: 'register-result',
},
],
},
{
name: 'account',
icon: 'user',
......
import React, { PureComponent } from 'react';
import { Select, message, List, Switch, Divider, Icon } from 'antd';
import { Select, message, List, Switch, Divider, Icon, Button } from 'antd';
import DrawerMenu from 'rc-drawer';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import { connect } from 'dva';
......@@ -184,18 +184,6 @@ class SettingDarwer extends PureComponent {
onMaskClick={this.togglerContent}
>
<div className={styles.content}>
<CopyToClipboard
text={JSON.stringify(setting)}
onCopy={() => message.success('copy success')}
>
<div className={styles.clipboard}>
<img
src="https://gw.alipayobjects.com/zos/rmsportal/YuWymXLusbplhCwgZwMT.svg"
alt="Copy To Clipboard"
width={18}
/>
</div>
</CopyToClipboard>
<Body title="整体风格设置">
<BlockChecbox
list={[
......@@ -255,6 +243,19 @@ class SettingDarwer extends PureComponent {
色弱模式
</List.Item>
</Body>
<Divider />
<CopyToClipboard
text={JSON.stringify(setting)}
onCopy={() => message.success('copy success')}
>
<Button
style={{
width: 224,
}}
>
<Icon type="copy" />拷贝代码
</Button>
</CopyToClipboard>
</div>
</DrawerMenu>
);
......
......@@ -6,14 +6,6 @@
padding: 24px;
background: #fff;
position: relative;
.clipboard {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
width: 16px;
height: 16px;
}
}
.blockChecbox {
......
import './polyfill';
// TODO remove
// import dva from 'dva';
// import createHistory from 'history/createHashHistory';
// // user BrowserHistory
// // import createHistory from 'history/createBrowserHistory';
// import createLoading from 'dva-loading';
// import 'moment/locale/zh-cn';
// import './rollbar';
// import './index.less';
// // 1. Initialize
// const app = dva({
// history: createHistory(),
// });
// // 2. Plugins
// app.use(createLoading());
// // 3. Register global model
// app.model(require('./models/global').default);
// // 4. Router
// app.router(require('./router').default);
// // 5. Start
// app.start('#root');
// export default app._store; // eslint-disable-line
import { routerRedux } from 'dva/router';
import { query } from '../services/error';
export default {
......@@ -12,8 +11,6 @@ export default {
effects: {
*query({ payload }, { call, put }) {
yield call(query, payload.code);
// redirect on client when network broken
yield put(routerRedux.push(`/exception/${payload.code}`));
yield put({
type: 'trigger',
payload: payload.code,
......
......@@ -59,8 +59,6 @@ export default class LoginPage extends Component {
});
};
loginForm;
renderMessage = content => {
return <Alert style={{ marginBottom: 24 }} message={content} type="error" showIcon />;
};
......
......@@ -29,7 +29,6 @@ const { check } = Authorized;
* @param {Object} routerData 路由配置
*/
const getBreadcrumbNameMap = memoizeOne((meun, router) => {
console.log(meun, router);
const routerMap = {};
const mergeMeunAndRouter = meunData => {
meunData.forEach(meunItem => {
......
import React, { Fragment } from 'react';
import { Link } from 'dva/router';
// import DocumentTitle from 'react-document-title';
import { Icon } from 'antd';
import GlobalFooter from '../../components/GlobalFooter';
import styles from './UserLayout.less';
import logo from '../../assets/logo.svg';
// TODO:remove
// import { getRoutes, getPageQuery, getQueryPath } from '../utils/utils';
const links = [
{
key: 'help',
......@@ -32,17 +28,9 @@ const copyright = (
Copyright <Icon type="copyright" /> 2018 蚂蚁金服体验技术部出品
</Fragment>
);
// TODO:remove
// function getLoginPathWithRedirectPath() {
// const params = getPageQuery();
// const { redirect } = params;
// return getQueryPath('/user/login', {
// redirect,
// });
// }
class UserLayout extends React.PureComponent {
// TODO title
// @TODO title
// getPageTitle() {
// const { routerData, location } = this.props;
// const { pathname } = location;
......@@ -56,7 +44,7 @@ class UserLayout extends React.PureComponent {
render() {
const { children } = this.props;
return (
// TODO <DocumentTitle title={this.getPageTitle()}>
// @TODO <DocumentTitle title={this.getPageTitle()}>
<div className={styles.container}>
<div className={styles.content}>
<div className={styles.top}>
......@@ -69,21 +57,9 @@ class UserLayout extends React.PureComponent {
<div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div>
</div>
{children}
{/* <Switch>
{getRoutes(match.path, routerData).map(item => (
<Route
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
/>
))}
<Redirect from="/user" to={getLoginPathWithRedirectPath()} />
</Switch> */}
</div>
<GlobalFooter links={links} copyright={copyright} />
</div>
// </DocumentTitle>
);
}
}
......
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