Browse Source

fix(1111): 修复跳转地址,吧写死的改成配置的

master
丁翠 7 months ago
parent
commit
52baa0e007
4 changed files with 38 additions and 9 deletions
  1. +24
    -7
      digital-future-summit/src/app/implementation/layout/layout.component.ts
  2. +10
    -0
      digital-future-summit/src/app/implementation/service/common.service.ts
  3. +2
    -1
      digital-future-summit/src/assets/api.dev.json
  4. +2
    -1
      digital-future-summit/src/assets/api.json

+ 24
- 7
digital-future-summit/src/app/implementation/layout/layout.component.ts View File

@ -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);
}
}


+ 10
- 0
digital-future-summit/src/app/implementation/service/common.service.ts View File

@ -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 {


+ 2
- 1
digital-future-summit/src/assets/api.dev.json View File

@ -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@",


+ 2
- 1
digital-future-summit/src/assets/api.json View File

@ -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@",


Loading…
Cancel
Save