|
@@ -1116,6 +1116,13 @@ const handlePortalAppClick = async (app: PortalApp) => {
|
|
|
|
|
|
|
|
if (app.label === "供应商管理(SRM)") {
|
|
if (app.label === "供应商管理(SRM)") {
|
|
|
if (userStore.getUser.username && getAccessToken()) {
|
|
if (userStore.getUser.username && getAccessToken()) {
|
|
|
|
|
+ const ua = window.navigator.userAgent;
|
|
|
|
|
+ const isDesktop =
|
|
|
|
|
+ ua.includes("DingTalk") &&
|
|
|
|
|
+ (ua.includes("Windows") || ua.includes("Macintosh"));
|
|
|
|
|
+
|
|
|
|
|
+ let ua2 = navigator.userAgent.toLowerCase();
|
|
|
|
|
+ var isMobile = ua2.indexOf("dingtalk") > -1;
|
|
|
const res = await srmLogin({
|
|
const res = await srmLogin({
|
|
|
username: userStore.getUser.username,
|
|
username: userStore.getUser.username,
|
|
|
});
|
|
});
|
|
@@ -1125,7 +1132,21 @@ const handlePortalAppClick = async (app: PortalApp) => {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (res) {
|
|
|
|
|
|
|
+ if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
|
|
|
|
|
+ if (isMobile && !isDesktop) {
|
|
|
|
|
+ dd.biz.util.openLink({
|
|
|
|
|
+ url: `https://srm-m.deepoil.cc:4430`,
|
|
|
|
|
+
|
|
|
|
|
+ onSuccess: () => {},
|
|
|
|
|
+ });
|
|
|
|
|
+ } else if (isDesktop) {
|
|
|
|
|
+ window.open(
|
|
|
|
|
+ `https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
|
|
|
|
|
+ "_blank",
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 浏览器环境
|
|
|
window.open(
|
|
window.open(
|
|
|
`https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
|
|
`https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
|
|
|
"_blank",
|
|
"_blank",
|