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

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

View File

@ -21,19 +21,15 @@ 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,
}) });
.then(async resp => {
const respJson = resp.data; const respJson = resp.data;
const audioUrl = respJson.data.audioUrl; const audioUrl = respJson.data.audioUrl;
await downloadAudio(audioUrl, path) return await downloadAudio(audioUrl, path)
.catch(err => { .catch(err => {
console.error(`下载音乐失败,错误信息为: ${ err.message }`); console.error(`下载音乐失败,错误信息为: ${ err.message }`);
}); });
return respJson;
});
} }
/** /**