Browse Source

去除写死TOKEN

master
董书康 6 months ago
parent
commit
1d17779950
3 changed files with 18 additions and 13 deletions
  1. +2
    -2
      digital-future-summit/src/app/implementation/layout/layout.component.html
  2. +3
    -2
      digital-future-summit/src/app/implementation/layout/layout.component.less
  3. +13
    -9
      digital-future-summit/src/app/implementation/layout/layout.component.ts

+ 2
- 2
digital-future-summit/src/app/implementation/layout/layout.component.html View File

@ -76,7 +76,7 @@
</div>
<div id="data_assistant" appDraggable [dragEnable]="dragEnable" (dragEvent)="handleElementDrag($event)"
class="box box-assistant" (click)="jumpToSystem('data_assistant')">
class="box box-assistant" (click)="jumpToSystem('data_assistantX')">
<span>高管数智助理</span>
</div>
@ -98,7 +98,7 @@
<div id="SSO_mes" appDraggable [dragEnable]="dragEnable" (dragEvent)="handleElementDrag($event)"
class="box box-SSO_mes" (click)="jumpToSystem('SSO_mes')">
class="box box-SSO_mes" (click)="jumpToSystem('SSO_mesX')">
<span>智能生产控制</span>
</div>


+ 3
- 2
digital-future-summit/src/app/implementation/layout/layout.component.less View File

@ -44,9 +44,8 @@
.container .box {
position: absolute;
z-index: 1000;
font-size: large;
font-size: 14px;
text-align: center;
padding: 10px 10px;
cursor: pointer;
display: none;
// border: 1px solid #ddd;
@ -54,6 +53,8 @@
/* 添加过渡效果 */
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
/* 添加阴影效果 */
border-radius: 10px;
/* 添加圆角边,可以指定具体的像素值 */
}
.container .box:hover {


+ 13
- 9
digital-future-summit/src/app/implementation/layout/layout.component.ts View File

@ -10,11 +10,11 @@ import {
Renderer2,
} from "@angular/core";
import {
DigiMiddlewareAuthApp,
DigiMiddlewareAuthUser,
DigiMiddlewareAuthApp
} from "app/config/app-auth-token";
import { CommonService } from "../service/common.service";
import { NzPopconfirmComponent } from 'ng-zorro-antd/popconfirm';
import { NzMessageService } from "ng-zorro-antd/message";
@Component({
selector: "app-layout",
@ -27,6 +27,8 @@ export class LayoutComponent implements OnInit, AfterViewInit {
queryDisplayList = [];
USER_ID = "";
USER_TOKEN = "";
dragEnable: boolean = false;
isDragging: boolean = false;
@ -64,7 +66,8 @@ export class LayoutComponent implements OnInit, AfterViewInit {
constructor(
private commonService: CommonService,
private el: ElementRef,
private renderer: Renderer2
private renderer: Renderer2,
private message: NzMessageService
) { }
ngOnInit(): void {
this.systemMaps = systemList;
@ -80,7 +83,7 @@ export class LayoutComponent implements OnInit, AfterViewInit {
*/
initSystemBySemcSSO() {
const DwUserInfo = JSON.parse(sessionStorage.getItem("DwUserInfo"));
this.USER_TOKEN = DwUserInfo.token;
this.USER_ID = DwUserInfo.userId;
this.dragEnable =
this.USER_ID === "dongsk@digiwin.com" || this.USER_ID === "M00020";
@ -89,7 +92,7 @@ export class LayoutComponent implements OnInit, AfterViewInit {
const headers = {
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp,
"Digi-Middleware-Auth-User": DigiMiddlewareAuthUser,
"Digi-Middleware-Auth-User": this.USER_TOKEN,
};
const url =
this.commonService.semcUrl + "/tenant/semc/applink/queryDisplayList";
@ -142,7 +145,7 @@ export class LayoutComponent implements OnInit, AfterViewInit {
},
{
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp,
"Digi-Middleware-Auth-User": DigiMiddlewareAuthUser,
"Digi-Middleware-Auth-User": this.USER_TOKEN,
}
)
.then((res) => {
@ -179,6 +182,7 @@ export class LayoutComponent implements OnInit, AfterViewInit {
}
if (this.systemMaps[key] == null) {
this.message.error(`${key} 未集成`);
return;
}
@ -192,7 +196,7 @@ export class LayoutComponent implements OnInit, AfterViewInit {
const headers = {
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp,
"Digi-Middleware-Auth-User": DigiMiddlewareAuthUser,
"Digi-Middleware-Auth-User": this.USER_TOKEN,
};
// 单点登录
@ -352,7 +356,7 @@ export class LayoutComponent implements OnInit, AfterViewInit {
this.divContent,
{
"Digi-Middleware-Auth-App": DigiMiddlewareAuthApp,
"Digi-Middleware-Auth-User": DigiMiddlewareAuthUser,
"Digi-Middleware-Auth-User": this.USER_TOKEN
}
)
.then((res) => {


Loading…
Cancel
Save