|
@@ -761,8 +761,14 @@ const handleSearch = () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleQuickAccessCommand = (command: string) => {
|
|
const handleQuickAccessCommand = (command: string) => {
|
|
|
|
|
+ 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 ua2 = navigator.userAgent.toLowerCase();
|
|
|
let isMobile = ua2.indexOf("dingtalk") > -1;
|
|
let isMobile = ua2.indexOf("dingtalk") > -1;
|
|
|
|
|
+
|
|
|
const routeMap: Record<string, string> = {
|
|
const routeMap: Record<string, string> = {
|
|
|
"todo-oa": "/todo-list?type=oa",
|
|
"todo-oa": "/todo-list?type=oa",
|
|
|
"done-oa": "/oa-done-list?type=oa",
|
|
"done-oa": "/oa-done-list?type=oa",
|
|
@@ -785,32 +791,32 @@ const handleQuickAccessCommand = (command: string) => {
|
|
|
|
|
|
|
|
let target = null;
|
|
let target = null;
|
|
|
|
|
|
|
|
- console.log("执行快捷访问:", command);
|
|
|
|
|
- if (isMobile) {
|
|
|
|
|
- if (command === "todo-oa") {
|
|
|
|
|
- dd.biz.util.openLink({
|
|
|
|
|
- url: `https://yfding.keruioil.com:9443/wxapi/wxclientmenu/61c40c87c45346ce9695f223ea823278`,
|
|
|
|
|
|
|
+ if (ua2.includes("dingtalk") || ua2.includes("dingtalkwork")) {
|
|
|
|
|
+ if (isMobile && !isDesktop) {
|
|
|
|
|
+ if (command === "todo-oa" || command === "done-oa") {
|
|
|
|
|
+ dd.biz.util.openLink({
|
|
|
|
|
+ url: `https://yfding.keruioil.com:9443/wxapi/wxclientmenu/61c40c87c45346ce9695f223ea823278`,
|
|
|
|
|
|
|
|
- onSuccess: () => {},
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (command === "done-oa") {
|
|
|
|
|
- dd.biz.util.openLink({
|
|
|
|
|
- url: `https://yfding.keruioil.com:9443/wxapi/wxclientmenu/61c40c87c45346ce9695f223ea823278`,
|
|
|
|
|
-
|
|
|
|
|
- onSuccess: () => {},
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ onSuccess: () => {},
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ target = routeMap2[command];
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (isDesktop) {
|
|
|
|
|
+ target = routeMap[command];
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (isMobile && command !== "todo-oa" && command !== "done-oa") {
|
|
|
|
|
- target = routeMap2[command];
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ // 浏览器环境
|
|
|
target = routeMap[command];
|
|
target = routeMap[command];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ console.log(
|
|
|
|
|
+ "🚀 ~ file: index.vue ~ line 91 ~ handleQuickAccessCommand ~ target",
|
|
|
|
|
+ target,
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ // 跳转
|
|
|
if (target) {
|
|
if (target) {
|
|
|
router.push(target);
|
|
router.push(target);
|
|
|
}
|
|
}
|