mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-15 05:10:47 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
9d2afee91c
@ -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);
|
||||
};
|
||||
};
|
||||
|
@ -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 = {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user