From e92d6cec9619f5e102d9e90753d56f12980c2074 Mon Sep 17 00:00:00 2001 From: QZMusic Date: Thu, 4 Jun 2026 14:23:39 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=EF=BC=8C=E4=BF=AE=E5=A4=8DTypeScript?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +- src/App.vue | 13 +-- src/components/player/MusicInfo.vue | 6 +- src/components/player/TextMarquee.vue | 2 +- src/main.ts | 7 +- src/plugins/impl/defaultPlugin.ts | 51 +++++++++ src/plugins/index.ts | 3 + src/plugins/init.ts | 10 ++ src/plugins/pluginManager.ts | 73 ++++++++++++ src/stores/player.ts | 1 - src/types/index.ts | 2 + src/types/plugin.ts | 30 +++++ src/views/Playlist.vue | 27 ++--- src/views/Search.vue | 154 +++++++------------------- 14 files changed, 231 insertions(+), 151 deletions(-) create mode 100644 src/plugins/impl/defaultPlugin.ts create mode 100644 src/plugins/index.ts create mode 100644 src/plugins/init.ts create mode 100644 src/plugins/pluginManager.ts create mode 100644 src/types/index.ts create mode 100644 src/types/plugin.ts diff --git a/README.md b/README.md index e1255f7..20d0d3b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # QZMusic Web -QZMusic 网页版,基于 Vue 3 + TypeScript + Vite 构建的音乐播放器。 +QZMusic 网页版,基于 Vue 3 + TypeScript + Vite 构建的音乐播放器,支持插件系统获取音乐资源。 ## 功能特性 @@ -10,6 +10,7 @@ QZMusic 网页版,基于 Vue 3 + TypeScript + Vite 构建的音乐播放器。 - 🎚️ 音量控制 - 📊 音频可视化(基于 Web Audio API) - 🔍 搜索功能 +- 🔌 **插件系统** - 支持通过插件获取音乐资源 - 🌐 默认端口:10096 ## 快速开始 diff --git a/src/App.vue b/src/App.vue index 33f18a6..e820db9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,15 +16,14 @@ const showSettings = ref(false); provide('openSettings', () => { showSettings.value = true; }); // Apply saved theme on app startup -onMounted(async () => { - if (window.electronAPI?.settings) { - const settings = await window.electronAPI.settings.getAll(); - document.documentElement.setAttribute('data-theme', settings.theme); - document.documentElement.style.setProperty('--color-accent', settings.accentColor); - } +onMounted(() => { + const savedTheme = localStorage.getItem('qz-theme') || 'dark'; + const savedAccentColor = localStorage.getItem('qz-accent-color') || '#ec4141'; + document.documentElement.setAttribute('data-theme', savedTheme); + document.documentElement.style.setProperty('--color-accent', savedAccentColor); }); \ No newline at end of file + diff --git a/src/components/player/MusicInfo.vue b/src/components/player/MusicInfo.vue index bf722c9..fd2e88a 100644 --- a/src/components/player/MusicInfo.vue +++ b/src/components/player/MusicInfo.vue @@ -13,9 +13,7 @@ {{ album }} - @@ -23,7 +21,7 @@ -