|
@ -33,7 +33,7 @@ export class LayoutComponent implements OnInit { |
|
|
// 请求获取user_token
|
|
|
// 请求获取user_token
|
|
|
switch (type) { |
|
|
switch (type) { |
|
|
case "DMP": |
|
|
case "DMP": |
|
|
this.getUserToken(type, this.systemList["T100bs"]); |
|
|
|
|
|
|
|
|
this.getUserToken(type, this.systemList["DMP"]); |
|
|
break; |
|
|
break; |
|
|
case "chatFile": |
|
|
case "chatFile": |
|
|
this.getUserToken(type, this.systemList["chatFile"]); |
|
|
this.getUserToken(type, this.systemList["chatFile"]); |
|
@ -71,7 +71,7 @@ export class LayoutComponent implements OnInit { |
|
|
}; |
|
|
}; |
|
|
this.commonService |
|
|
this.commonService |
|
|
.getRequestWithHeaders( |
|
|
.getRequestWithHeaders( |
|
|
"https://semc.apps.digiwincloud.com.cn/tenant/semc/applink/queryDisplayList", |
|
|
|
|
|
|
|
|
this.commonService.semcUrl + "/tenant/semc/applink/queryDisplayList", |
|
|
headers |
|
|
headers |
|
|
) |
|
|
) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
@ -84,14 +84,29 @@ export class LayoutComponent implements OnInit { |
|
|
* 通过tenantId获取用户token |
|
|
* 通过tenantId获取用户token |
|
|
*/ |
|
|
*/ |
|
|
async getUserToken(type, item) { |
|
|
async getUserToken(type, item) { |
|
|
|
|
|
console.log("item", item); |
|
|
if (item.ssoLogin) { |
|
|
if (item.ssoLogin) { |
|
|
// 单点登录跳转 queryDisplayList接口的数据 底部 e10 t100
|
|
|
// 单点登录跳转 queryDisplayList接口的数据 底部 e10 t100
|
|
|
console.log("单点登录跳转录的方式", type); |
|
|
|
|
|
|
|
|
// 需要拼applicationAppId
|
|
|
|
|
|
console.log("单点登录跳转的方式", type); |
|
|
|
|
|
let url = ""; |
|
|
const queryDisplayList = this.queryDisplayList.filter((arr) => { |
|
|
const queryDisplayList = this.queryDisplayList.filter((arr) => { |
|
|
return arr.code === type; |
|
|
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) { |
|
|
} else if (item.mockLogin) { |
|
|
console.log("模拟登录的方式", type); |
|
|
console.log("模拟登录的方式", type); |
|
|
// 通过书康哥接口请求 模拟登录
|
|
|
// 通过书康哥接口请求 模拟登录
|
|
@ -101,8 +116,9 @@ export class LayoutComponent implements OnInit { |
|
|
this.user_info.tenantId = DwUserInfo["tenantId"]; |
|
|
this.user_info.tenantId = DwUserInfo["tenantId"]; |
|
|
this.user_info.productKey = type; |
|
|
this.user_info.productKey = type; |
|
|
console.log("user_info", this.user_info); |
|
|
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 |
|
|
this.commonService |
|
|
.postWithHeaders(getUrl, this.user_info, {}) |
|
|
.postWithHeaders(getUrl, this.user_info, {}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
@ -134,6 +150,7 @@ export class LayoutComponent implements OnInit { |
|
|
}); |
|
|
}); |
|
|
let url = ""; |
|
|
let url = ""; |
|
|
url = item.url + "/sso-login?userToken=" + this.userToken; |
|
|
url = item.url + "/sso-login?userToken=" + this.userToken; |
|
|
|
|
|
console.log("切换租户的方式url", url); |
|
|
window.open(url); |
|
|
window.open(url); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|