/**
|
* 徐祥健<xuxj@hugeinfo.com.cn>
|
* 2018年7月16日 19:43
|
*
|
*/
|
|
|
import React from 'react';
|
|
import { message } from 'antd';
|
|
|
import LoginView from '../view/LoginView';
|
|
import Fetch from '../fetch';
|
|
export default class Login extends React.Component {
|
constructor(props) {
|
super(props);
|
this.state = {
|
data: null
|
};
|
}
|
|
componentDidMount() {
|
document.title = '南沙区人民检察院便利化诉讼服务智能平台管理后台';
|
}
|
//登录
|
onClick = (userName, password) => {
|
if (!userName) {
|
message.warning('用户名不能为空!');
|
return;
|
}
|
if (!password) {
|
message.warning('密码不能为空!');
|
return;
|
}else{
|
password = btoa(password);
|
}
|
Fetch.userLogin({ userName, password }).then(res => {
|
console.log(res)
|
// debugger;
|
if (res.code === 0) {
|
// location.href = res.data;
|
location.href ='http://localhost:8080/index.html#/'
|
// location.href ='http://nsjcy.hugeinfo.com.cn/nsjc-charge/pc/index.html#/'
|
} else {
|
message.error(res.msg, 2)
|
}
|
})
|
}
|
render() {
|
return (
|
<div className="login-body">
|
<LoginView onClick={this.onClick} />
|
</div>
|
);
|
}
|
|
}
|