From 0e809098a3ccce5b88c731d1e1ffb87ad647d74b Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Thu, 23 Jun 2022 16:15:36 +0800 Subject: [PATCH] c --- src/app/pages/login/login.component.ts | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index c7d7294..f095a49 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -8,6 +8,7 @@ import { Base64 } from 'js-base64'; import { NzNotificationService } from 'ng-zorro-antd/notification'; import { NzSafeAny } from 'ng-zorro-antd/core/types'; import { SelectedMenu } from 'src/app/service/selectedMenu.service'; +import { THIS_EXPR } from '@angular/compiler/src/output/output_ast'; declare var abp: any @Component({ @@ -98,6 +99,7 @@ export class LoginComponent implements OnInit { userMenu = [] tap = [] menuList = [] + name="" submitForm(): void { 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'); - this.router.navigate(['/todaywarning/petrolStation']) + if(this.name=="今日预警"){ + this.router.navigate(['/todaywarning/petrolStation']) this.message.create('success', `登录成功`); sessionStorage.setItem('selectedMenu', '今日预警') + }else{ + this.router.navigate([this.menuList[0].url]) + this.message.create('success', `登录成功`); + sessionStorage.setItem('selectedMenu', this.menuList[0].name) + } } else { let a = sessionStorage.getItem('userdata') 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'); - this.router.navigate(['/homepage']) + if(this.name=="首页"){ + this.router.navigate(['/homepage']) this.message.create('success', `登录成功`); sessionStorage.setItem('selectedMenu', '首页') + }else{ + this.router.navigate([this.menuList[0].url]) + this.message.create('success', `登录成功`); + sessionStorage.setItem('selectedMenu', this.menuList[0].name) + } } } }, err => {