feat: 添加设置页面 可配置代理开关

This commit is contained in:
alger
2023-12-28 10:45:11 +08:00
parent c7c1143cb4
commit a2c49d354e
12 changed files with 173 additions and 16 deletions
+7
View File
@@ -175,6 +175,10 @@ const options = [
{
label: '退出登录',
key: 'logout'
},
{
label: '设置',
key: 'set'
}
]
@@ -208,6 +212,9 @@ const selectItem = async (key: any) => {
case 'login':
router.push("/login")
break;
case 'set':
router.push("/set")
break;
}
}
+12 -7
View File
@@ -1,5 +1,5 @@
<template>
<div id="title-bar" @mousedown="drag">
<div id="title-bar" @mousedown="drag" v-if="isElectron">
<div id="title">Alger Music</div>
<div id="buttons">
<button @click="minimize">
@@ -19,13 +19,18 @@
import { useDialog } from 'naive-ui'
const dialog = useDialog()
const windowData = window as any
const isElectron = computed(() => {
return !!windowData.electronAPI.minimize
})
const minimize = () => {
window.electronAPI.minimize()
windowData.electronAPI.minimize()
}
const maximize = () => {
window.electronAPI.maximize()
windowData.electronAPI.maximize()
}
const close = () => {
@@ -35,16 +40,16 @@ const close = () => {
positiveText: '最小化',
negativeText: '关闭',
onPositiveClick: () => {
window.electronAPI.miniTray()
windowData.electronAPI.miniTray()
},
onNegativeClick: () => {
window.electronAPI.close()
windowData.electronAPI.close()
}
})
}
const drag = (event: HTMLElement) => {
window.electronAPI.dragStart(event)
const drag = (event: MouseEvent) => {
windowData.electronAPI.dragStart(event)
}
</script>