Commit 9ee73576 authored by wangqinghua's avatar wangqinghua

update

parent 6bd0bc90
......@@ -17,6 +17,8 @@ import {NzNotificationService} from 'ng-zorro-antd';
import {LocalStorageService} from 'ngx-webstorage';
import {OverAllService} from '../../overAll/overAll.service';
import {SystemService} from '../../system/system.service';
import {Base64} from 'js-base64';
import {LayoutService} from '../../layouts/layout.service';
@Component({
selector: 'jhi-login-modal',
......@@ -46,6 +48,7 @@ export class JhiLoginModalComponent implements OnInit {
public $localStorage: LocalStorageService,
public overAll: OverAllService,
private sysSer: SystemService,
private layoutSer: LayoutService,
) {
this.credentials = {};
this.emitService.eventEmit.subscribe((value: any) => {
......@@ -65,7 +68,20 @@ export class JhiLoginModalComponent implements OnInit {
if (this.validateForm.invalid) {
return false;
}
this.login();
this.getEncodepassword();
}
getEncodepassword() {
const data = {
userName: this.validateForm.value.loginName,
password: Base64.encode(this.validateForm.value.password)
};
this.layoutSer.encodePassword(data).subscribe(
(res) => {
this.validateForm.patchValue({password: res.data});
this.login();
}
);
}
ngOnInit(): void {
......@@ -137,7 +153,11 @@ export class JhiLoginModalComponent implements OnInit {
this.userInfo.organizationName = res.data.name;
}
this.$localStorage.store('userInfo', this.userInfo);
}
}, (error1 => {
this.router.navigate(['app/main/home']);
this.notification.create('success', '登录成功', '', {nzDuration: 2000});
this.$localStorage.store('userInfo', this.userInfo);
})
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment