From 874ea59d3fcc5cc522a7d99a13ad0154f28baba8 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong <1040110848@qq.com> Date: Thu, 22 Apr 2021 21:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=EF=BC=9B=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 93 ++++++++++++++++++++++++++++++++--------- src/background.ts | 7 +++- src/components/Chat.vue | 37 ---------------- vue.config.js | 7 ++++ 4 files changed, 87 insertions(+), 57 deletions(-) delete mode 100644 src/components/Chat.vue create mode 100644 vue.config.js diff --git a/src/App.vue b/src/App.vue index 5028729..6ad1bca 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,28 +1,83 @@ diff --git a/src/background.ts b/src/background.ts index 13ac1c2..3617a4f 100644 --- a/src/background.ts +++ b/src/background.ts @@ -1,6 +1,6 @@ "use strict"; -import { app, protocol, BrowserWindow } from "electron"; +import { app, protocol, BrowserWindow, ipcMain } from "electron"; import { createProtocol } from "vue-cli-plugin-electron-builder/lib"; import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer"; const isDevelopment = process.env.NODE_ENV !== "production"; @@ -78,3 +78,8 @@ if (isDevelopment) { }); } } + +ipcMain.on("login", (event, nickname) => { + event.reply("loginStatus", true); + console.log(nickname); +}); diff --git a/src/components/Chat.vue b/src/components/Chat.vue deleted file mode 100644 index 20c9cca..0000000 --- a/src/components/Chat.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..cad8a5e --- /dev/null +++ b/vue.config.js @@ -0,0 +1,7 @@ +module.exports = { + pluginOptions: { + electronBuilder: { + nodeIntegration: true, + }, + }, +};