|
@@ -980,9 +980,30 @@ const handlePortalAppClick = async (app: PortalApp) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (app.label === "客户管理(CRM)") {
|
|
if (app.label === "客户管理(CRM)") {
|
|
|
- protectedOpen(
|
|
|
|
|
- `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}`,
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ if (userStore.getUser.username && getAccessToken()) {
|
|
|
|
|
+ const ua = window.navigator.userAgent.toLowerCase();
|
|
|
|
|
+ if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
|
|
|
|
|
+ if (window.dd) {
|
|
|
|
|
+ dd.biz.util.openLink({
|
|
|
|
|
+ url: "https://crm-tencent.xiaoshouyi.com/bff/spa/crmh5/index.html#/neo/startPage",
|
|
|
|
|
+
|
|
|
|
|
+ onSuccess: () => {},
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (window.DingTalkPC) {
|
|
|
|
|
+ window.open(
|
|
|
|
|
+ `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}`,
|
|
|
|
|
+ "_blank",
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ window.open(
|
|
|
|
|
+ `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}`,
|
|
|
|
|
+ "_blank",
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ router.push({ path: "/login" });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (app.label === "设备管理(PMS)") {
|
|
if (app.label === "设备管理(PMS)") {
|
|
@@ -1054,8 +1075,22 @@ const handlePortalAppClick = async (app: PortalApp) => {
|
|
|
const res = await ehrLogin({
|
|
const res = await ehrLogin({
|
|
|
username: userStore.getUser.username,
|
|
username: userStore.getUser.username,
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- if (res) {
|
|
|
|
|
|
|
+ const ua = window.navigator.userAgent.toLowerCase();
|
|
|
|
|
+ if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
|
|
|
|
|
+ if (window.dd) {
|
|
|
|
|
+ dd.biz.util.openLink({
|
|
|
|
|
+ url: `${res.ehrUrl}/gateway/login/free?loginfree_licence=${res.licence}&signature=${res.sign}&redirect_url=/proxy/h5/home`,
|
|
|
|
|
+
|
|
|
|
|
+ onSuccess: () => {},
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (window.DingTalkPC) {
|
|
|
|
|
+ window.open(
|
|
|
|
|
+ `${res.ehrUrl}/gateway/login/free?loginfree_licence=${res.licence}&signature=${res.sign}&redirect_url=${res.redirect}`,
|
|
|
|
|
+ "_blank",
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 浏览器环境
|
|
|
window.open(
|
|
window.open(
|
|
|
`${res.ehrUrl}/gateway/login/free?loginfree_licence=${res.licence}&signature=${res.sign}&redirect_url=${res.redirect}`,
|
|
`${res.ehrUrl}/gateway/login/free?loginfree_licence=${res.licence}&signature=${res.sign}&redirect_url=${res.redirect}`,
|
|
|
"_blank",
|
|
"_blank",
|