diff --git a/src/view/index.js b/src/view/index.js index 9a5c8ae..5a89102 100644 --- a/src/view/index.js +++ b/src/view/index.js @@ -12,10 +12,10 @@ import { Spin, message, Icon } from 'antd' const App = React.createClass({ getInitialState() { return { - // loading: true, - // login: false, - loading: false, - login: true, + loading: true, + login: false, + // loading: false, + // login: true, userName: '未登录', collapse: false, } diff --git a/src/view/user/signIn.js b/src/view/user/signIn.js index 169ab3a..958a2ea 100644 --- a/src/view/user/signIn.js +++ b/src/view/user/signIn.js @@ -19,8 +19,10 @@ let SignIn = React.createClass({ if (!!errors) { return } + _this.setState({ loading: true }) ajax.post(`${config.getAPIPath()}${config.login.validate}`) .type('form').send(values).end((err, res) => { + _this.setState({ loading: false }) if (ajax.isSuccess(res)) { if (this.props.loginSuccess) { this.props.loginSuccess(res.body.data, true) @@ -69,6 +71,10 @@ let SignIn = React.createClass({ 登录 +
+ 账号:guest + 密码:guest +
)