From bde9c2c1d46132ae03fd5f261eb520aec6178da6 Mon Sep 17 00:00:00 2001 From: gsx <530353222@qq.com> Date: Sat, 23 Apr 2022 18:43:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/utils/ipcRenderer.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/utils/ipcRenderer.js b/frontend/src/utils/ipcRenderer.js index 7a9d9ae..17695d2 100644 --- a/frontend/src/utils/ipcRenderer.js +++ b/frontend/src/utils/ipcRenderer.js @@ -19,24 +19,22 @@ const call = (ipc, channel, param) => { /** * 发送异步消息(invoke/handle 模型) - * @param ipc * @param channel * @param param * @returns {Promise} */ -const invoke = (ipc, channel, param) => { +const invoke = (channel, param) => { const message = ipc.invoke(channel, param); return message; } /** * 发送同步消息(send/on 模型) - * @param ipc * @param channel * @param param * @returns {Any} */ -const sendSync = (ipc, channel, param) => { +const sendSync = (channel, param) => { const message = ipc.sendSync(channel, param); return message; } @@ -45,7 +43,7 @@ export default { install(Vue) { Vue.prototype.$ipc = ipc // 全局注入ipc Vue.prototype.$ipcCall = (channel, param) => call(ipc, channel, param) - Vue.prototype.$ipcInvoke = (channel, param) => invoke(ipc, channel, param) - Vue.prototype.$ipcSendSync = (channel, param) => sendSync(ipc, channel, param) + Vue.prototype.$ipcInvoke = invoke + Vue.prototype.$ipcSendSync = sendSync } }