mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-29 20:44:05 +00:00
add login loading
This commit is contained in:
+4
-4
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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({
|
||||
登录
|
||||
</Button>
|
||||
</Row>
|
||||
<p style={{color:'#ccc',textAlign:'center'}} className='m-y-sm'>
|
||||
<span className='mr'>账号:guest</span>
|
||||
<span>密码:guest</span>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user