🎈 perf: 优化歌曲列表以及图片加载

This commit is contained in:
alger
2024-06-05 15:35:31 +08:00
parent 9fcf455c08
commit 2f851f3172
4 changed files with 42 additions and 21 deletions
+5 -2
View File
@@ -60,8 +60,11 @@ export const getMusicProxyUrl = (url: string) => {
export const getImgUrl = computed(() => (url: string | undefined, size: string = '') => {
const bdUrl = 'https://image.baidu.com/search/down?url=';
const imgUrl = encodeURIComponent(`${url}?param=${size}`);
return `${bdUrl}${imgUrl}`;
const imgUrl = `${url}?param=${size}`;
if (!getIsMc()) {
return imgUrl;
}
return `${bdUrl}${encodeURIComponent(imgUrl)}`;
});
export const isMobile = computed(() => {