|
|
@ -58,6 +58,21 @@ class Login extends Component { |
|
|
|
this.handleChange = this.handleChange.bind(this); |
|
|
|
this.handleChange = this.handleChange.bind(this); |
|
|
|
this.showHide = this.showHide.bind(this); |
|
|
|
this.showHide = this.showHide.bind(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
updatePageTitle = () => { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const storedData = localStorage.getItem('configApp'); |
|
|
|
|
|
|
|
if (storedData !== null) { |
|
|
|
|
|
|
|
const data = JSON.parse(storedData); |
|
|
|
|
|
|
|
const htmlTitle = data.html_title || 'OSPRO'; |
|
|
|
|
|
|
|
console.log('htmlTitle', htmlTitle); |
|
|
|
|
|
|
|
document.getElementById('title').innerText = htmlTitle; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
document.title = 'OSPRO'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
document.title = 'OSPRO'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
showHide(e) { |
|
|
|
showHide(e) { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopPropagation(); |
|
|
@ -255,6 +270,7 @@ class Login extends Component { |
|
|
|
window.localStorage.setItem('all_project', data_user.role.all_project); |
|
|
|
window.localStorage.setItem('all_project', data_user.role.all_project); |
|
|
|
window.localStorage.setItem('hierarchy', JSON.stringify(data_user.hierarchy)); |
|
|
|
window.localStorage.setItem('hierarchy', JSON.stringify(data_user.hierarchy)); |
|
|
|
window.localStorage.setItem('configApp', JSON.stringify(data_user.configApp)); |
|
|
|
window.localStorage.setItem('configApp', JSON.stringify(data_user.configApp)); |
|
|
|
|
|
|
|
this.updatePageTitle(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// NotificationManager.error('Cek username atau password anda!', 'Gagal Login!');
|
|
|
|
// NotificationManager.error('Cek username atau password anda!', 'Gagal Login!');
|
|
|
|
NotificationManager.error(doLogin.data.message, 'Login Failed!'); |
|
|
|
NotificationManager.error(doLogin.data.message, 'Login Failed!'); |
|
|
|