diff --git a/digital-future-summit/src/app/implementation/layout/layout.component.ts b/digital-future-summit/src/app/implementation/layout/layout.component.ts index f3cbd7e..4e1afb2 100644 --- a/digital-future-summit/src/app/implementation/layout/layout.component.ts +++ b/digital-future-summit/src/app/implementation/layout/layout.component.ts @@ -33,7 +33,7 @@ export class LayoutComponent implements OnInit { // 请求获取user_token switch (type) { case "DMP": - this.getUserToken(type, this.systemList["T100bs"]); + this.getUserToken(type, this.systemList["DMP"]); break; case "chatFile": this.getUserToken(type, this.systemList["chatFile"]); @@ -71,7 +71,7 @@ export class LayoutComponent implements OnInit { }; this.commonService .getRequestWithHeaders( - "https://semc.apps.digiwincloud.com.cn/tenant/semc/applink/queryDisplayList", + this.commonService.semcUrl + "/tenant/semc/applink/queryDisplayList", headers ) .then((res) => { @@ -84,14 +84,29 @@ export class LayoutComponent implements OnInit { * 通过tenantId获取用户token */ async getUserToken(type, item) { + console.log("item", item); if (item.ssoLogin) { // 单点登录跳转 queryDisplayList接口的数据 底部 e10 t100 - console.log("单点登录跳转录的方式", type); + // 需要拼applicationAppId + console.log("单点登录跳转的方式", type); + let url = ""; const queryDisplayList = this.queryDisplayList.filter((arr) => { return arr.code === type; }); - // console.log("cloudwebsite", queryDisplayList[0]["cloudwebsite"]); - window.open(queryDisplayList[0]["cloudwebsite"]); + // console.log("queryDisplayList111", queryDisplayList); + if ( + queryDisplayList.length > 0 && + queryDisplayList[0]?.applicationAppId + ) { + url = + queryDisplayList[0]["cloudwebsite"] + + "&code=" + + queryDisplayList[0].applicationAppId; + } else { + url = queryDisplayList[0]["cloudwebsite"]; + } + console.log("单点登录url", url); + window.open(url); } else if (item.mockLogin) { console.log("模拟登录的方式", type); // 通过书康哥接口请求 模拟登录 @@ -101,8 +116,9 @@ export class LayoutComponent implements OnInit { this.user_info.tenantId = DwUserInfo["tenantId"]; this.user_info.productKey = type; console.log("user_info", this.user_info); - const getUrl = - "https://demo-athenaopt.apps.digiwincloud.com.cn/restful/standard/demo/api/default/login"; + let getUrl = ""; + getUrl = + this.commonService.apiUrl + "/restful/standard/demo/api/default/login"; this.commonService .postWithHeaders(getUrl, this.user_info, {}) .then((res) => { @@ -134,6 +150,7 @@ export class LayoutComponent implements OnInit { }); let url = ""; url = item.url + "/sso-login?userToken=" + this.userToken; + console.log("切换租户的方式url", url); window.open(url); } } diff --git a/digital-future-summit/src/app/implementation/service/common.service.ts b/digital-future-summit/src/app/implementation/service/common.service.ts index bccf18c..8088abb 100644 --- a/digital-future-summit/src/app/implementation/service/common.service.ts +++ b/digital-future-summit/src/app/implementation/service/common.service.ts @@ -13,6 +13,8 @@ export class CommonService { frcUrl: any; eocUrl: any; iamUrl: any; + apiUrl: any; + semcUrl: any; themeMapUrl: any; pageData: any; // 记录机制的content参数 @@ -51,6 +53,14 @@ export class CommonService { this.iamUrl = url; console.log("iamUrl", this.iamUrl); }); + this.configService.get("apiUrl").subscribe((url: string): void => { + this.apiUrl = url; + console.log("api", this.apiUrl); + }); + this.configService.get("semcUrl").subscribe((url: string): void => { + this.semcUrl = url; + console.log("semcUrl", this.semcUrl); + }); } getHeader(): any { diff --git a/digital-future-summit/src/assets/api.dev.json b/digital-future-summit/src/assets/api.dev.json index 52a7096..525f88e 100755 --- a/digital-future-summit/src/assets/api.dev.json +++ b/digital-future-summit/src/assets/api.dev.json @@ -1,6 +1,7 @@ { - "apiUrl": "@WEB_SERVICE_URL@", + "apiUrl": "https://demo-athenaopt.apps.digiwincloud.com.cn", "iamUrl":"https://iam.digiwincloud.com.cn", + "semcUrl":"https://semc.apps.digiwincloud.com.cn", "emcUrl": "@EMC_SERVICE_URL@", "omUrl": "@OM_URL@", "consoleUrl": "@CONSOLE_URL@", diff --git a/digital-future-summit/src/assets/api.json b/digital-future-summit/src/assets/api.json index 52a7096..525f88e 100755 --- a/digital-future-summit/src/assets/api.json +++ b/digital-future-summit/src/assets/api.json @@ -1,6 +1,7 @@ { - "apiUrl": "@WEB_SERVICE_URL@", + "apiUrl": "https://demo-athenaopt.apps.digiwincloud.com.cn", "iamUrl":"https://iam.digiwincloud.com.cn", + "semcUrl":"https://semc.apps.digiwincloud.com.cn", "emcUrl": "@EMC_SERVICE_URL@", "omUrl": "@OM_URL@", "consoleUrl": "@CONSOLE_URL@",