From 7d4505eb44212b2e4c725907e9112707405c7c2a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?= <8473136@qq.com>
Date: Fri, 1 Dec 2023 16:34:34 +0800
Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=A2=9E=E5=8A=A0=E6=89=93?=
=?UTF-8?q?=E5=BC=80github?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
electron/api/github.ts | 9 ++++++++-
src/layout/compoenets/LeftMenu.vue | 11 +++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/electron/api/github.ts b/electron/api/github.ts
index 383c986..46e2624 100644
--- a/electron/api/github.ts
+++ b/electron/api/github.ts
@@ -1,4 +1,4 @@
-import {app, BrowserWindow, ipcMain, net} from "electron";
+import {app, BrowserWindow, ipcMain, net, shell} from "electron";
import {insertVersion} from "../storage/version";
const fs = require("fs");
@@ -162,4 +162,11 @@ export const initGitHubApi = () => {
}
});
});
+
+ /**
+ * 打开GitHub
+ */
+ ipcMain.on("github.open", () => {
+ shell.openExternal("https://github.com/luckjiawei/frpc-desktop");
+ })
};
diff --git a/src/layout/compoenets/LeftMenu.vue b/src/layout/compoenets/LeftMenu.vue
index 917bd25..3dd3ecc 100644
--- a/src/layout/compoenets/LeftMenu.vue
+++ b/src/layout/compoenets/LeftMenu.vue
@@ -3,6 +3,7 @@ import { computed, defineComponent, onMounted, ref } from "vue";
import { Icon } from "@iconify/vue";
import router from "@/router";
import { RouteRecordRaw } from "vue-router";
+import {ipcRenderer} from "electron";
defineComponent({
name: "AppMain"
@@ -27,6 +28,10 @@ const handleMenuChange = (route: RouteRecordRaw) => {
});
};
+const handleOpenGitHub = () => {
+ ipcRenderer.send("github.open")
+}
+
onMounted(() => {
routes.value = router.options.routes[0].children?.filter(
f => !f.meta?.hidden
@@ -49,6 +54,12 @@ onMounted(() => {
>