From 15395e3ff6241a0a92aee66ca2de7325d43b9b50 Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 6 May 2024 22:29:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=BF=AB=E6=8D=B7=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E6=94=AF=E6=8C=81base64=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/plugin.json | 108 +++++++++++++++++--------------- src/pages/ConfigurationPage.vue | 13 +++- 2 files changed, 68 insertions(+), 53 deletions(-) diff --git a/plugin/plugin.json b/plugin/plugin.json index cb32767..befc579 100644 --- a/plugin/plugin.json +++ b/plugin/plugin.json @@ -1,59 +1,65 @@ { - "pluginName": "快捷命令", - "description": "快速打开软件、网址及运行批处理、shell等脚本,免编写插件使用utools的api及实现UI交互", - "main": "index.html", - "homepage": "https://github.com/fofolee/uTools-quickcommand", - "publishPage": "https://yuanliao.info/d/424", - "version": "4.0.3", - "development": { - "main": "http://127.0.0.1:8080/" + "pluginName": "快捷命令", + "description": "快速打开软件、网址及运行批处理、shell等脚本,免编写插件使用utools的api及实现UI交互", + "main": "index.html", + "homepage": "https://github.com/fofolee/uTools-quickcommand", + "publishPage": "https://yuanliao.info/d/424", + "version": "4.0.3", + "development": { + "main": "http://127.0.0.1:8080/" + }, + "author": "云之轩", + "logo": "logo.png", + "preload": "preload.js", + "pluginSetting": { + "single": false + }, + "features": [ + { + "code": "configuration", + "explain": "创建或编辑快捷命令", + "cmds": [ + "快捷命令", + "QuickCommand" + ] }, - "author": "云之轩", - "logo": "logo.png", - "preload": "preload.js", - "pluginSetting": { - "single": false + { + "code": "code", + "explain": "运行代码", + "cmds": [ + "运行代码", + "RunCode" + ], + "icon": "features/code.png" }, - "features": [ + { + "code": "newcommand", + "explain": "快速新建快捷命令", + "cmds": [ + "新建快捷命令", + "NewCommand", { - "code": "configuration", - "explain": "创建或编辑快捷命令", - "cmds": [ - "快捷命令", - "QuickCommand" - ] + "type": "regex", + "label": "新建快捷命令", + "match": "/^\\{[\\s\\S]*\"program\" *: *\".*\"[\\s\\S]*\"cmd\" *: *\".*\"[\\s\\S]*\\}$/i", + "maxNum": 1 }, { - "code": "code", - "explain": "运行代码", - "cmds": [ - "运行代码", - "RunCode" - ], - "icon": "features/code.png" - }, - { - "code": "newcommand", - "explain": "快速新建快捷命令", - "cmds": [ - "新建快捷命令", - "NewCommand", - { - "type": "regex", - "label": "新建快捷命令", - "match": "/^\\{[\\s\\S]*\"program\" *: *\".*\"[\\s\\S]*\"cmd\" *: *\".*\"[\\s\\S]*\\}$/i", - "maxNum": 1 - } - ] - }, - { - "code": "server", - "explain": "配置快捷命令后台服务", - "cmds": [ - "快捷命令服务配置", - "quickcommandServer" - ], - "icon": "features/server.png" + "type": "regex", + "label": "新建快捷命令", + "match": "/^qc=eyJwcm9ncmFtIj/", + "maxNum": 1 } - ] + ] + }, + { + "code": "server", + "explain": "配置快捷命令后台服务", + "cmds": [ + "快捷命令服务配置", + "quickcommandServer" + ], + "icon": "features/server.png" + } + ] } diff --git a/src/pages/ConfigurationPage.vue b/src/pages/ConfigurationPage.vue index 5cb3b10..c0fadab 100644 --- a/src/pages/ConfigurationPage.vue +++ b/src/pages/ConfigurationPage.vue @@ -321,8 +321,17 @@ export default { initPage() { // 如果从 newcommand 进入则直接新建命令 if (this.newCommandDirect) { - if (this.$root.enterData.type === "text") this.addNewCommand(); - else this.editCommand(JSON.parse(this.$root.enterData.payload)); + if (this.$root.enterData.type === "text") { + this.addNewCommand(); + } else if (this.$root.enterData.payload.slice(0, 3) === "qc=") { + this.editCommand( + JSON.parse( + window.base64Decode(this.$root.enterData.payload.slice(3)) + ) + ); + } else { + this.editCommand(JSON.parse(this.$root.enterData.payload)); + } this.$router.push("/configuration"); } if (this.$route.params.tags) {