陈鹏飞 2 years ago
parent
commit
0e809098a3
  1. 26
      src/app/pages/login/login.component.ts

26
src/app/pages/login/login.component.ts

@ -8,6 +8,7 @@ import { Base64 } from 'js-base64';
import { NzNotificationService } from 'ng-zorro-antd/notification'; import { NzNotificationService } from 'ng-zorro-antd/notification';
import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzSafeAny } from 'ng-zorro-antd/core/types';
import { SelectedMenu } from 'src/app/service/selectedMenu.service'; import { SelectedMenu } from 'src/app/service/selectedMenu.service';
import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';
declare var abp: any declare var abp: any
@Component({ @Component({
@ -98,6 +99,7 @@ export class LoginComponent implements OnInit {
userMenu = [] userMenu = []
tap = [] tap = []
menuList = [] menuList = []
name=""
submitForm(): void { submitForm(): void {
if (!this.remember) { if (!this.remember) {
@ -161,10 +163,20 @@ export class LoginComponent implements OnInit {
} }
} }
} }
for (let index = 0; index < this.tap.length; index++) {
if(this.tap[index]=="今日预警") {this.name="今日预警"}
}
sessionStorage.setItem("isGasStation", 'true'); sessionStorage.setItem("isGasStation", 'true');
this.router.navigate(['/todaywarning/petrolStation']) if(this.name=="今日预警"){
this.router.navigate(['/todaywarning/petrolStation'])
this.message.create('success', `登录成功`); this.message.create('success', `登录成功`);
sessionStorage.setItem('selectedMenu', '今日预警') sessionStorage.setItem('selectedMenu', '今日预警')
}else{
this.router.navigate([this.menuList[0].url])
this.message.create('success', `登录成功`);
sessionStorage.setItem('selectedMenu', this.menuList[0].name)
}
} else { } else {
let a = sessionStorage.getItem('userdata') let a = sessionStorage.getItem('userdata')
this.userMenu = JSON.parse(a).menus this.userMenu = JSON.parse(a).menus
@ -179,10 +191,20 @@ export class LoginComponent implements OnInit {
} }
} }
} }
for (let index = 0; index < this.tap.length; index++) {
if(this.tap[index]=="首页") {this.name="首页"}
}
sessionStorage.setItem("isGasStation", 'false'); sessionStorage.setItem("isGasStation", 'false');
this.router.navigate(['/homepage']) if(this.name=="首页"){
this.router.navigate(['/homepage'])
this.message.create('success', `登录成功`); this.message.create('success', `登录成功`);
sessionStorage.setItem('selectedMenu', '首页') sessionStorage.setItem('selectedMenu', '首页')
}else{
this.router.navigate([this.menuList[0].url])
this.message.create('success', `登录成功`);
sessionStorage.setItem('selectedMenu', this.menuList[0].name)
}
} }
} }
}, err => { }, err => {

Loading…
Cancel
Save