|
|
@@ -986,13 +986,51 @@ const handlePortalAppClick = async (app: PortalApp) => {
|
|
|
}
|
|
|
|
|
|
if (app.label === "OA办公") {
|
|
|
+ // if (userStore.getUser.username && getAccessToken()) {
|
|
|
+ // const res = await ssoLogin({ username: userStore.getUser.username });
|
|
|
+ // if (res) {
|
|
|
+ // window.open(
|
|
|
+ // `https://yfoa.keruioil.com/wui/index.html?ssoToken=${res}#/main`,
|
|
|
+ // "_blank",
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // router.push({ path: "/login" });
|
|
|
+ // }
|
|
|
+
|
|
|
if (userStore.getUser.username && getAccessToken()) {
|
|
|
+ const ua = window.navigator.userAgent; // const ua = navigator.userAgent;
|
|
|
+ const isDesktop =
|
|
|
+ ua.includes("DingTalk") &&
|
|
|
+ (ua.includes("Windows") || ua.includes("Macintosh"));
|
|
|
+
|
|
|
+ let ua2 = navigator.userAgent.toLowerCase();
|
|
|
+ let isMobile = ua2.indexOf("dingtalk") > -1;
|
|
|
+
|
|
|
const res = await ssoLogin({ username: userStore.getUser.username });
|
|
|
- if (res) {
|
|
|
- window.open(
|
|
|
- `https://yfoa.keruioil.com/wui/index.html?ssoToken=${res}#/main`,
|
|
|
- "_blank",
|
|
|
- );
|
|
|
+ if (ua2.includes("dingtalk") || ua2.includes("dingtalkwork")) {
|
|
|
+ if (isMobile && !isDesktop) {
|
|
|
+ dd.biz.util.openLink({
|
|
|
+ url: `https://yfding.keruioil.com:9443/wxapi/wxclientmenu/a3c638fedfcd4945b58ec152a5bff0b7`,
|
|
|
+
|
|
|
+ onSuccess: () => {},
|
|
|
+ });
|
|
|
+ } else if (isDesktop) {
|
|
|
+ if (res) {
|
|
|
+ window.open(
|
|
|
+ `https://yfoa.keruioil.com/wui/index.html?ssoToken=${res}#/main`,
|
|
|
+ "_blank",
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 浏览器
|
|
|
+ if (res) {
|
|
|
+ window.open(
|
|
|
+ `https://yfoa.keruioil.com/wui/index.html?ssoToken=${res}#/main`,
|
|
|
+ "_blank",
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
router.push({ path: "/login" });
|