Commit e7a78e7d authored by 陈帅's avatar 陈帅

bugfix: fix trigger error

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