- harness.html 照抄 index.html:30-34 的 ztree.css / jquery / lodash / jquery.ztree: main.ts 不 import 这几个全局脚本,靠 html 提供;缺 jquery 会稳定报 "Uncaught ReferenceError: $ is not defined"(本项目既有坑) - harness-main.ts 新增 /apps 空壳路由(只需 route.name === "apps" 让 Header 渲染放大镜, 不挂真实 AppList 以免本机无后端时报错污染控制台)与 ?cmd=1[&q=xx] 取证钩子 (自动点开放大镜并可选输入关键词)
This commit is contained in:
@@ -5,6 +5,12 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>harness-取证</title>
|
<title>harness-取证</title>
|
||||||
|
<!-- 照抄 index.html:30-34:main.ts 不 import 这几个全局脚本,靠 html 提供。
|
||||||
|
缺 jquery ⇒ "$ is not defined" ⇒ v-wave / vuescroll 抛错(本项目固有坑) -->
|
||||||
|
<link rel="stylesheet" href="./libs/ztree/zTreeStyle.css" />
|
||||||
|
<script src="./libs/jquery.min.js"></script>
|
||||||
|
<script src="./libs/lodash.min.js"></script>
|
||||||
|
<script src="./libs/ztree/jquery.ztree.all.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -27,7 +27,12 @@ import AppHeader from "@/components/AppHeader.vue";
|
|||||||
import UserInfoModal from "@/components/UserInfoModal.vue";
|
import UserInfoModal from "@/components/UserInfoModal.vue";
|
||||||
import mittBus from "@/utils/mitt";
|
import mittBus from "@/utils/mitt";
|
||||||
|
|
||||||
|
/** 命令面板取证用空壳路由:只需 route.name === "apps" 让 Header 渲染放大镜,
|
||||||
|
* 不挂真实 AppList(避免本机无后端时 getUserApp 失败污染控制台) */
|
||||||
|
const CmdEmptyShell = defineComponent({ setup: () => () => h("div", { style: "height:100%" }) });
|
||||||
|
|
||||||
const harnessRoutes: any[] = [
|
const harnessRoutes: any[] = [
|
||||||
|
{ path: "/apps", name: "apps", component: CmdEmptyShell, meta: { title: "应用" } },
|
||||||
{ path: "/msg", name: "Msg", component: MsgPage, meta: { title: "消息" } },
|
{ path: "/msg", name: "Msg", component: MsgPage, meta: { title: "消息" } },
|
||||||
{ path: "/settings", name: "Settings", component: SettingsPage, meta: { title: "设置" } },
|
{ path: "/settings", name: "Settings", component: SettingsPage, meta: { title: "设置" } },
|
||||||
{ path: "/theme-preview", name: "ThemePreview", component: ThemePreviewPage, meta: { title: "主题预览" } },
|
{ path: "/theme-preview", name: "ThemePreview", component: ThemePreviewPage, meta: { title: "主题预览" } },
|
||||||
@@ -258,3 +263,25 @@ function runAssert(attempt: number) {
|
|||||||
document.title = "HARNESS-READY";
|
document.title = "HARNESS-READY";
|
||||||
}
|
}
|
||||||
setTimeout(() => runAssert(0), 1500);
|
setTimeout(() => runAssert(0), 1500);
|
||||||
|
|
||||||
|
// ===== 命令面板取证:?cmd=1[&q=课] 自动点开放大镜并可选输入;配合 #/apps =====
|
||||||
|
if (params.get("cmd") === "1") {
|
||||||
|
setTimeout(() => {
|
||||||
|
const btn = document.querySelector(".operate-container .icon-box") as HTMLElement | null;
|
||||||
|
btn?.click();
|
||||||
|
const q = params.get("q");
|
||||||
|
setTimeout(
|
||||||
|
() => {
|
||||||
|
if (q) {
|
||||||
|
const inp = document.querySelector(".app-cmdk-hd input") as HTMLInputElement | null;
|
||||||
|
if (inp) {
|
||||||
|
inp.value = q;
|
||||||
|
inp.dispatchEvent(new Event("input"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setTimeout(() => ((window as any).__CMDK_READY__ = true), 600);
|
||||||
|
},
|
||||||
|
q ? 500 : 600
|
||||||
|
);
|
||||||
|
}, 900);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user