|
|
@@ -124,28 +124,50 @@ const goBackPage = async (row) => {
|
|
|
const res = await srmLogin({
|
|
|
username: userStore.getUser.username,
|
|
|
});
|
|
|
+ if (JSON.parse(res).msg === "账号未授权") {
|
|
|
+ dialogVisible.value = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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;
|
|
|
if (res) {
|
|
|
- const token = JSON.parse(res).msg;
|
|
|
- const ua = window.navigator.userAgent.toLowerCase();
|
|
|
-
|
|
|
- if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
|
|
|
- dd.biz.util.openLink({
|
|
|
- url: `https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${token}`,
|
|
|
- onSuccess: () => {
|
|
|
- setTimeout(() => {
|
|
|
- dd.biz.util.openLink({
|
|
|
- url: `https://srm.deepoil.cc/#/workflow-process/request-${row.requestId}`,
|
|
|
- });
|
|
|
- }, 300);
|
|
|
- },
|
|
|
- });
|
|
|
+ if (ua2.includes("dingtalk") || ua2.includes("dingtalkwork")) {
|
|
|
+ if (isMobile && !isDesktop) {
|
|
|
+ dd.biz.util.openLink({
|
|
|
+ url: `https://srm-m.deepoil.cc:7777?Authorization=${JSON.parse(res).msg}`,
|
|
|
+ // onSuccess: () => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // dd.biz.util.openLink({
|
|
|
+ // url: `https://srm.deepoil.cc/#/workflow-process/request-${row.requestId}`,
|
|
|
+ // });
|
|
|
+ // }, SRM_LOGIN_DELAY);
|
|
|
+ // },
|
|
|
+ });
|
|
|
+ } else if (isDesktop) {
|
|
|
+ dd.biz.util.openLink({
|
|
|
+ url: `https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
|
|
|
+ onSuccess: () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ dd.biz.util.openLink({
|
|
|
+ url: `https://srm.deepoil.cc/#/workflow-process/request-${row.requestId}`,
|
|
|
+ });
|
|
|
+ }, SRM_LOGIN_DELAY);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
const newTab = window.open("", "_blank");
|
|
|
- newTab.location.href = `https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${token}`;
|
|
|
- setTimeout(() => {
|
|
|
+ newTab.location.href = `https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`;
|
|
|
+ setTimeout(function () {
|
|
|
+ setTimeout(() => {}, 500);
|
|
|
newTab.location.href = `https://srm.deepoil.cc/#/workflow-process/request-${row.requestId}`;
|
|
|
- }, 300);
|
|
|
+ }, SRM_LOGIN_DELAY);
|
|
|
}
|
|
|
}
|
|
|
};
|