🐞 fix: 修复 bodian 无法发送的问题

This commit is contained in:
zhiyu1998 2024-06-23 17:21:53 +08:00
parent df37390108
commit 7ae76b6143

View File

@ -21,18 +21,14 @@ async function getBodianAudio(id, path) {
"Cache-Control": "no-cache", "Cache-Control": "no-cache",
channel: "appstore", channel: "appstore",
}; };
return await axios const resp = await axios.get(API, {
.get(API, { headers,
headers, });
}) const respJson = resp.data;
.then(async resp => { const audioUrl = respJson.data.audioUrl;
const respJson = resp.data; return await downloadAudio(audioUrl, path)
const audioUrl = respJson.data.audioUrl; .catch(err => {
await downloadAudio(audioUrl, path) console.error(`下载音乐失败,错误信息为: ${ err.message }`);
.catch(err => {
console.error(`下载音乐失败,错误信息为: ${err.message}`);
});
return respJson;
}); });
} }