mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
✨ feat: 添加云盘默认图片
This commit is contained in:
parent
f48da3b91f
commit
6b28f27ec4
@ -150,7 +150,11 @@ export class songRequest extends plugin {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
let imgList = {}
|
let imgList = {}
|
||||||
for (let i = 0; i < res.data.songs.length; i++) {
|
for (let i = 0; i < res.data.songs.length; i++) {
|
||||||
imgList[res.data.songs[i].id] = res.data.songs[i].al.picUrl;
|
if (res.data.songs[i].al.includes('109951169484091680.jpg')) {
|
||||||
|
imgList[res.data.songs[i].id] = 'def'
|
||||||
|
} else {
|
||||||
|
imgList[res.data.songs[i].id] = res.data.songs[i].al.picUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (let i = 0; i < musicDate.data.length; i++) {
|
for (let i = 0; i < musicDate.data.length; i++) {
|
||||||
const songId = musicDate.data[i].id;
|
const songId = musicDate.data[i].id;
|
||||||
@ -359,7 +363,7 @@ export class songRequest extends plugin {
|
|||||||
throw new Error('上传失败,响应不正确');
|
throw new Error('上传失败,响应不正确');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
await retryAxiosReq(() => tryUpload())
|
await retryAxiosReq(() => tryUpload())
|
||||||
@ -426,7 +430,7 @@ export class songRequest extends plugin {
|
|||||||
cleanPath = await downloadAudio(cleanPath, this.getCurDownloadPath(e), songName, "manual", fileFormat);
|
cleanPath = await downloadAudio(cleanPath, this.getCurDownloadPath(e), songName, "manual", fileFormat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info(`[R插件][云盘] 上传路径审计: ${ cleanPath }`);
|
logger.info(`[R插件][云盘] 上传路径审计: ${cleanPath}`);
|
||||||
// 使用 splitPaths 提取信息
|
// 使用 splitPaths 提取信息
|
||||||
const [{ dir: dirPath, fileName, extension, baseFileName }] = splitPaths(cleanPath);
|
const [{ dir: dirPath, fileName, extension, baseFileName }] = splitPaths(cleanPath);
|
||||||
// 文件名拆解为两部分
|
// 文件名拆解为两部分
|
||||||
|
@ -69,6 +69,7 @@ html {
|
|||||||
width: 135px;
|
width: 135px;
|
||||||
height: 135px;
|
height: 135px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
object-fit: cover;
|
||||||
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
|
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,14 +12,22 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="bg-image">
|
<div class="bg-image">
|
||||||
|
{{ if songInfo.cover == 'def' }}
|
||||||
<img src="{{ songInfo.cover }}" alt="" class="img" width="100%">
|
<img src="{{ songInfo.cover }}" alt="" class="img" width="100%">
|
||||||
|
{{ else }}
|
||||||
|
<img src="{{pluResPath}}img/default.png" alt="" class="img" width="100%">
|
||||||
|
{{ /if }}
|
||||||
<div class="inner"></div>
|
<div class="inner"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="infoBox">
|
<div class="infoBox">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="songinfobox">
|
<div class="songinfobox">
|
||||||
<div class="cover">
|
<div class="cover">
|
||||||
|
{{ if songInfo.cover == 'def' }}
|
||||||
<img src="{{ songInfo.cover }}" alt="">
|
<img src="{{ songInfo.cover }}" alt="">
|
||||||
|
{{ else }}
|
||||||
|
<img src="{{pluResPath}}img/default.png" alt="">
|
||||||
|
{{ /if }}
|
||||||
</div>
|
</div>
|
||||||
<div class="songSize">
|
<div class="songSize">
|
||||||
{{ songInfo.size }}
|
{{ songInfo.size }}
|
||||||
|
@ -95,6 +95,7 @@ html {
|
|||||||
height: 90px;
|
height: 90px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bgicon {
|
.bgicon {
|
||||||
|
@ -16,7 +16,11 @@
|
|||||||
<div class="songListNav">
|
<div class="songListNav">
|
||||||
<div class="navInfo">
|
<div class="navInfo">
|
||||||
<div class="number">{{ key+1 }}</div>
|
<div class="number">{{ key+1 }}</div>
|
||||||
<img src="{{ info.cover }}" alt="">
|
{{ if info.cover == 'def' }}
|
||||||
|
<img src="{{ info.cover }}" alt="">
|
||||||
|
{{ else }}
|
||||||
|
<img src="{{pluResPath}}imgdefault.png" alt="">
|
||||||
|
{{ /if }}
|
||||||
<div class="navText">
|
<div class="navText">
|
||||||
<div class="songName">{{ info.songName }}</div>
|
<div class="songName">{{ info.songName }}</div>
|
||||||
<div class="singerText">{{ info.singerName }}</div>
|
<div class="singerText">{{ info.singerName }}</div>
|
||||||
|
BIN
resources/img/default.png
Normal file
BIN
resources/img/default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 MiB |
Loading…
x
Reference in New Issue
Block a user