|
|
|
@ -5,7 +5,7 @@ import "slick-carousel/slick/slick-theme.css";
|
|
|
|
|
import Slider from "react-slick"; |
|
|
|
|
import { Spin } from 'antd'; |
|
|
|
|
import { Checkbox } from 'antd'; |
|
|
|
|
import { LoadingOutlined } from '@ant-design/icons'; |
|
|
|
|
import { LoadingOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'; |
|
|
|
|
import { |
|
|
|
|
Button, |
|
|
|
|
Card, |
|
|
|
@ -64,11 +64,19 @@ class Login extends Component {
|
|
|
|
|
validate: { |
|
|
|
|
emailState: '', |
|
|
|
|
}, |
|
|
|
|
loader: false |
|
|
|
|
loader: false, |
|
|
|
|
type: 'password' |
|
|
|
|
} |
|
|
|
|
this.handleChange = this.handleChange.bind(this); |
|
|
|
|
this.showHide = this.showHide.bind(this); |
|
|
|
|
} |
|
|
|
|
showHide(e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
e.stopPropagation(); |
|
|
|
|
this.setState({ |
|
|
|
|
type: this.state.type === 'input' ? 'password' : 'input' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
validateEmail(e) { |
|
|
|
|
const emailRex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
|
|
|
|
const { validate } = this.state |
|
|
|
@ -163,7 +171,9 @@ class Login extends Component {
|
|
|
|
|
window.localStorage.setItem('user_name', data_user.name); |
|
|
|
|
window.localStorage.setItem('role_id', data_user.role_id); |
|
|
|
|
} else { |
|
|
|
|
NotificationManager.error('Cek username atau password anda!', 'Gagal Login!'); |
|
|
|
|
console.log("kode : ", doLogin.data.code); |
|
|
|
|
// NotificationManager.error('Cek username atau password anda!', 'Gagal Login!');
|
|
|
|
|
NotificationManager.error(doLogin.data.message, 'Login Failed!'); |
|
|
|
|
this.setState({ loader: false }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -286,15 +296,23 @@ class Login extends Component {
|
|
|
|
|
<i className="icon-lock"></i> |
|
|
|
|
</InputGroupText> |
|
|
|
|
</InputGroupAddon> |
|
|
|
|
|
|
|
|
|
<Input |
|
|
|
|
type="password" |
|
|
|
|
type={this.state.type} |
|
|
|
|
name="password" |
|
|
|
|
id="examplePassword" |
|
|
|
|
placeholder="********" |
|
|
|
|
value={password} |
|
|
|
|
onChange={(e) => this.setState({ password: e.target.value })} |
|
|
|
|
/> |
|
|
|
|
<InputGroupAddon addonType="prepend"> |
|
|
|
|
<InputGroupText |
|
|
|
|
onClick={this.showHide} |
|
|
|
|
> |
|
|
|
|
{this.state.type === 'input' ? <EyeOutlined /> : <EyeInvisibleOutlined />} |
|
|
|
|
|
|
|
|
|
</InputGroupText> |
|
|
|
|
</InputGroupAddon> |
|
|
|
|
<span className="password__show" ></span> |
|
|
|
|
</InputGroup> |
|
|
|
|
<Row> |
|
|
|
|
<Col xs="8"> |
|
|
|
|