Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
sean 2017-08-22 20:44:36 +08:00
commit 9d2afee91c
3 changed files with 12 additions and 1 deletions

View File

@ -37,3 +37,11 @@ exports.logoSVG = (length) => (<svg className="svg" width={length} height={lengt
</g>
</g>
</svg>);
exports.debounce = (func, wait) => {
let timeout;
return function() {
clearTimeout(timeout);
timeout = setTimeout(func, wait);
};
};

View File

@ -6,6 +6,7 @@ import { delFollow, addFollow } from '../../reducer/modules/follow';
// import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router';
import { debounce } from '../../common';
@connect(
state => {
@ -22,6 +23,8 @@ import { withRouter } from 'react-router';
class ProjectCard extends Component {
constructor(props) {
super(props);
this.add = debounce(this.add, 400);
this.del = debounce(this.del, 400);
}
static propTypes = {

View File

@ -44,7 +44,7 @@ class Login extends Component {
if (!err) {
this.props.loginActions(values).then((res) => {
if (res.payload.data.errcode == 0) {
this.props.history.push('/');
this.props.history.push('/group');
message.success('登录成功! ');
} else {
message.error(res.payload.data.errmsg);