diff --git a/plugin/preload.js b/plugin/preload.js index 3e56f8a..bcbbcc1 100644 --- a/plugin/preload.js +++ b/plugin/preload.js @@ -32,6 +32,8 @@ let isProcessExits = pid => { } } +window.isAppVersion4 = () => utools.getAppVersion() >= "4.0.0"; + // 多开检测 window.multiProcessDetection = () => { let pids = JSON.parse(localStorage.getItem('processes')) || []; diff --git a/src/App.vue b/src/App.vue index e302cf8..63bfe0f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -62,20 +62,21 @@ export default defineComponent({ this.utools.whole.onPluginEnter((enter) => { this.enterPlugin(enter); }); - this.utools.whole.onMainPush( - async ({ code, type, payload }) => { - let result = await this.runCommand(code, payload, 5000); - return result.map((x) => { - return { - text: x, - }; - }); - }, - ({ code, type, payload, option }) => { - window.quickcommand.writeClipboard(option.text); - window.utools.showNotification("已复制"); - } - ); + window.isAppVersion4() && + this.utools.whole.onMainPush( + async ({ code, type, payload }) => { + let result = await this.runCommand(code, payload, 5000); + return result.map((x) => { + return { + text: x, + }; + }); + }, + ({ code, type, payload, option }) => { + window.quickcommand.writeClipboard(option.text); + window.utools.showNotification("已复制"); + } + ); this.utools.whole.onPluginOut(() => { this.outPlugin(); }); diff --git a/src/components/CommandSideBar.vue b/src/components/CommandSideBar.vue index c1f8f31..f536148 100644 --- a/src/components/CommandSideBar.vue +++ b/src/components/CommandSideBar.vue @@ -23,13 +23,37 @@ />