diff --git a/CHANGELOG.md b/CHANGELOG.md index b3708b0..f4ad4e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,11 @@ # 更新日志 -## v3.9.0 -### ✨ 新功能 -- 添加歌曲右键菜单功能,支持添加到歌单、创建歌单、取消收藏等操作 -- 添加下一首播放功能(右键歌曲) -- 添加自动播放和自动保存正在播放列表功能(设置->播放设置->自动播放) -- 优化歌词滚动体验 - -### ⚡ 优化 -- 升级 Electron 版本和相关依赖包 -- 优化播放体验和代码结构 +## v3.9.2 ### 🐞 修复 -- 修复我的收藏查看更多跳转空白页的问题 - +- 修复下载功能导致的登陆失败问题 +- 优化下载功能 +- 添加下载按钮显隐配置 默认隐藏(设置页面配置) ## 咖啡☕️ | 微信 | | 支付宝 | diff --git a/README.md b/README.md index 8f85293..a400fd9 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,6 @@ QQ群:789288579 ## 咖啡☕️ -[](https://api.gitsponsors.com/api/badge/link?p=GTUHmTNQ9W5XzPhaLd8cPBm26uhtP/QOon9hexaWh9gnfaDT3ivj1ID0uKScVHL61jTFrK1fRWyigScIYvcLh/no+3zgtdW3TK0+vN0TVs84Mt3RibhEqAgBHSd8KhNLxaMd4vMIY37P5gOA2/QYcw==) - | 微信 | 支付宝 | | :--------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------: | | WeChat QRcode | Wechat QRcode | diff --git a/package.json b/package.json index 5a47882..d09d554 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "AlgerMusicPlayer", - "version": "3.9.0", + "version": "3.9.2", "description": "Alger Music Player", "author": "Alger ", "main": "./out/main/index.js", diff --git a/src/main/modules/fileManager.ts b/src/main/modules/fileManager.ts index ae3cb93..be46448 100644 --- a/src/main/modules/fileManager.ts +++ b/src/main/modules/fileManager.ts @@ -60,13 +60,22 @@ export function initializeFileManager() { // 通用的打开目录处理 ipcMain.on('open-directory', (_, filePath) => { try { - if (fs.statSync(filePath).isDirectory()) { - shell.openPath(filePath); + // 验证文件路径 + if (!filePath) { + console.error('无效的文件路径: 路径为空'); + return; + } + + // 统一处理路径分隔符 + const normalizedPath = path.normalize(filePath); + + if (fs.statSync(normalizedPath).isDirectory()) { + shell.openPath(normalizedPath); } else { - shell.showItemInFolder(filePath); + shell.showItemInFolder(normalizedPath); } } catch (error) { - console.error('Error opening path:', error); + console.error('打开路径失败:', error); } }); diff --git a/src/main/set.json b/src/main/set.json index 94d9657..e6a70aa 100644 --- a/src/main/set.json +++ b/src/main/set.json @@ -19,5 +19,6 @@ "fontScope": "global", "autoPlay": false, "downloadPath": "", - "language": "zh-CN" + "language": "zh-CN", + "alwaysShowDownloadButton": false } diff --git a/src/renderer/api/donation.ts b/src/renderer/api/donation.ts new file mode 100644 index 0000000..5c4cf78 --- /dev/null +++ b/src/renderer/api/donation.ts @@ -0,0 +1,20 @@ +import axios from 'axios'; + +export interface Donor { + id: number; + name: string; + amount: number; + date: string; + message?: string; + avatar?: string; + badge: string; + badgeColor: string; +} + +/** + * 获取捐赠列表 + */ +export const getDonationList = async (): Promise => { + const { data } = await axios.get('http://110.42.251.190:8766/api/donations'); + return data; +}; diff --git a/src/renderer/api/music.ts b/src/renderer/api/music.ts index 7bf2560..236f892 100644 --- a/src/renderer/api/music.ts +++ b/src/renderer/api/music.ts @@ -13,16 +13,25 @@ export const getMusicQualityDetail = (id: number) => { }; // 根据音乐Id获取音乐播放URl -export const getMusicUrl = async (id: number) => { - const res = await request.get('/song/download/url/v1', { - params: { - id, - level: store.state.setData.musicQuality || 'higher' - } - }); +export const getMusicUrl = async (id: number, isDownloaded: boolean = false) => { + // 判断是否登录 + try { + if (store.state.user && isDownloaded && store.state.user.vipType !== 0) { + const url = '/song/download/url/v1'; + const res = await request.get(url, { + params: { + id, + level: store.state.setData.musicQuality || 'higher', + cookie: `${localStorage.getItem('token')} os=pc;` + } + }); - if (res.data.data.url) { - return { data: { data: [{ ...res.data.data }] } }; + if (res.data.data.url) { + return { data: { data: [{ ...res.data.data }] } }; + } + } + } catch (error) { + console.error('error', error); } return await request.get('/song/url/v1', { @@ -80,8 +89,10 @@ export const likeSong = (id: number, like: boolean = true) => { }; // 获取用户喜欢的音乐列表 -export const getLikedList = () => { - return request.get('/likelist'); +export const getLikedList = (uid: number) => { + return request.get('/likelist', { + params: { uid } + }); }; // 创建歌单 diff --git a/src/renderer/components.d.ts b/src/renderer/components.d.ts index be65431..4e08703 100644 --- a/src/renderer/components.d.ts +++ b/src/renderer/components.d.ts @@ -27,14 +27,11 @@ declare module 'vue' { NInput: typeof import('naive-ui')['NInput'] NInputNumber: typeof import('naive-ui')['NInputNumber'] NLayout: typeof import('naive-ui')['NLayout'] - NList: typeof import('naive-ui')['NList'] - NListItem: typeof import('naive-ui')['NListItem'] NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NModal: typeof import('naive-ui')['NModal'] NPopover: typeof import('naive-ui')['NPopover'] NProgress: typeof import('naive-ui')['NProgress'] NRadio: typeof import('naive-ui')['NRadio'] - NRadioButton: typeof import('naive-ui')['NRadioButton'] NRadioGroup: typeof import('naive-ui')['NRadioGroup'] NScrollbar: typeof import('naive-ui')['NScrollbar'] NSelect: typeof import('naive-ui')['NSelect'] @@ -46,7 +43,6 @@ declare module 'vue' { NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] NTooltip: typeof import('naive-ui')['NTooltip'] - NTransfer: typeof import('naive-ui')['NTransfer'] NVirtualList: typeof import('naive-ui')['NVirtualList'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/src/renderer/components/common/DonationList.vue b/src/renderer/components/common/DonationList.vue index e61282c..68f4cd0 100644 --- a/src/renderer/components/common/DonationList.vue +++ b/src/renderer/components/common/DonationList.vue @@ -106,38 +106,24 @@