🦄 refactor: 重构整个项目 优化打包 修改后台服务为本地运行 添加更新版本检测功能

This commit is contained in:
alger
2025-01-01 02:25:18 +08:00
parent f8d421c9b1
commit 17d20fa299
260 changed files with 78557 additions and 1693 deletions
@@ -0,0 +1,71 @@
<template>
<div id="title-bar" @mousedown="drag">
<div id="title">Alger Music</div>
<div id="buttons">
<button @click="minimize">
<i class="iconfont icon-minisize"></i>
</button>
<button @click="close">
<i class="iconfont icon-close"></i>
</button>
</div>
</div>
</template>
<script setup lang="ts">
import { useDialog } from 'naive-ui';
import { isElectron } from '@/utils';
const dialog = useDialog();
const minimize = () => {
if (!isElectron) {
return;
}
window.api.minimize();
};
const close = () => {
if (!isElectron) {
return;
}
dialog.warning({
title: '提示',
content: '确定要退出吗?',
positiveText: '最小化',
negativeText: '关闭',
onPositiveClick: () => {
window.api.minimize();
},
onNegativeClick: () => {
window.api.close();
}
});
};
const drag = (event: MouseEvent) => {
if (!isElectron) {
return;
}
window.api.dragStart(event as unknown as string);
};
</script>
<style scoped lang="scss">
#title-bar {
-webkit-app-region: drag;
@apply flex justify-between px-6 py-2 select-none relative;
@apply text-dark dark:text-white;
z-index: 9999999;
}
#buttons {
@apply flex gap-4;
-webkit-app-region: no-drag;
}
button {
@apply text-gray-600 dark:text-gray-400 hover:text-green-500;
}
</style>