Skip to content

Commit

Permalink
Merge pull request #44 from imsyy/dev
Browse files Browse the repository at this point in the history
fix: 修复下载歌曲异常 #43
  • Loading branch information
imsyy authored May 29, 2023
2 parents b23c267 + ee7fe27 commit 4bd76ce
Show file tree
Hide file tree
Showing 25 changed files with 854 additions and 339 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"qrcode.vue": "^3.3.3",
"sass": "^1.56.1",
"screenfull": "^6.0.2",
"swiper": "^9.3.2",
"throttle-debounce": "^5.0.0",
"vite-plugin-html": "^3.2.0",
"vue": "^3.2.45",
Expand Down
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 3 additions & 12 deletions src/components/DataList/CoverLists.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
lazy
class="coverImg"
preview-disabled
:src="getCoverUrl(item.cover)"
:src="getCoverUrl(item.cover, 300)"
fallback-src="/images/pic/default.png"
>
<template #placeholder>
Expand All @@ -35,7 +35,7 @@
lazy
class="shadow"
preview-disabled
:src="getCoverUrl(item.cover)"
:src="getCoverUrl(item.cover, 300)"
fallback-src="/images/pic/default.png"
/>
<n-icon class="play" size="40">
Expand Down Expand Up @@ -118,6 +118,7 @@ import { musicStore, userStore, settingStore } from "@/store";
import { useRouter } from "vue-router";
import AllArtists from "./AllArtists.vue";
import PlaylistUpdate from "@/components/DataModal/PlaylistUpdate.vue";
import getCoverUrl from "@/utils/getCoverUrl";
const { t } = useI18n();
const router = useRouter();
Expand Down Expand Up @@ -171,16 +172,6 @@ const renderIcon = (icon) => {
};
};
// 封面图像地址
const getCoverUrl = (url) => {
if (!url) return "/images/pic/default.png";
const imageUrl = url.replace(/^http:/, "https:");
if (imageUrl.endsWith(".jpg")) {
return imageUrl + "?param=300y300";
}
return imageUrl;
};
// 右键菜单数据
const rightMenuX = ref(0);
const rightMenuY = ref(0);
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataModal/DownloadSong.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const toSongDownload = (id, br, name) => {
if (res.data.url) {
const type = res.data.type.toLowerCase();
const songName = name ? name : t("general.name.unknownSong");
fetch(res.data.url)
fetch(res.data.url.replace(/^http:/, "https:"))
.then((response) => response.blob())
.then((blob) => {
const url = window.URL.createObjectURL(blob);
Expand Down
1 change: 1 addition & 0 deletions src/components/Nav/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ const dropdownSelect = (key) => {
setting.getSiteTheme == "light"
? setting.setSiteTheme("dark")
: setting.setSiteTheme("light");
setting.themeAuto = false;
break;
// 播放历史
case "history":
Expand Down
2 changes: 1 addition & 1 deletion src/components/Personalized/PaPersonalFm.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
class="papersonalfm"
v-if="music.getPersonalFmData.id"
v-if="music.getPersonalFmData?.id"
:style="`background-image: url(${music.getPersonalFmData.album.picUrl.replace(
/^http:/,
'https:'
Expand Down
Loading

1 comment on commit 4bd76ce

@vercel
Copy link

@vercel vercel bot commented on 4bd76ce May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

s-music-player – ./

s-music-player-git-master-imsyy.vercel.app
s-music-player-imsyy.vercel.app
s-music-player.vercel.app

Please sign in to comment.