From e40f82cc51a61c8c847f475bbf7bda27f2cd8b71 Mon Sep 17 00:00:00 2001 From: Atdunbg Date: Fri, 29 May 2026 22:02:42 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=9B=E5=BB=BA=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=20API=20=E5=B0=81=E8=A3=85=E5=B1=82=EF=BC=8C=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=B8=8D=E5=86=8D=E7=9B=B4=E6=8E=A5=E8=B0=83=E7=94=A8?= =?UTF-8?q?=20invoke?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 src/api.ts,按职责分为 MusicApi/AudioApi/DeviceApi/DownloadApi/AppApi 五个命名空间 - 替换 15 个文件中所有 invoke 调用为 API 层方法 - 后端接口变更只需修改 api.ts 一处,便于后期迭代维护 --- src/App.vue | 12 +- src/api.ts | 196 ++++++++++++++++++++++++++++++ src/components/CommentSection.vue | 26 ++-- src/components/PlayerBar.vue | 6 +- src/components/Sidebar.vue | 4 +- src/composables/UserLyric.ts | 4 +- src/composables/useDownload.ts | 24 ++-- src/stores/player.ts | 72 ++++++----- src/stores/user.ts | 4 +- src/views/AlbumDetail.vue | 4 +- src/views/ArtistDetail.vue | 10 +- src/views/DailySongs.vue | 4 +- src/views/Discover.vue | 10 +- src/views/FavoriteSongs.vue | 6 +- src/views/Home.vue | 6 +- src/views/LocalMusic.vue | 8 +- src/views/Login.vue | 8 +- src/views/PlaylistDetail.vue | 6 +- src/views/Settings.vue | 8 +- 19 files changed, 302 insertions(+), 116 deletions(-) create mode 100644 src/api.ts diff --git a/src/App.vue b/src/App.vue index 0a3b1ef..6c33168 100644 --- a/src/App.vue +++ b/src/App.vue @@ -38,7 +38,6 @@