✨ 增加打开github
This commit is contained in:
parent
9bdeccaab2
commit
7d4505eb44
@ -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");
|
||||
})
|
||||
};
|
||||
|
@ -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(() => {
|
||||
>
|
||||
<Icon :icon="r?.meta?.icon as string" />
|
||||
</li>
|
||||
<li
|
||||
class="menu"
|
||||
@click="handleOpenGitHub"
|
||||
>
|
||||
<Icon icon="mdi:github" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user