Skip to content

Commit

Permalink
fix: 年度回顾分享图片获取失败
Browse files Browse the repository at this point in the history
  • Loading branch information
XasYer committed Dec 23, 2024
1 parent f03271b commit b9a6dd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function getImgUrlBuffer (url, retry = 3) {
const buffer = await request.get(path.pathname + path.search, {
responseType: 'arraybuffer',
baseURL: path.origin
}).then(res => res.data)
})
if (Version.BotName === 'Karin') {
return `base64://${buffer.toString('base64')}`
} else {
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function saveImg (url, retry = 3) {
baseURL: path.origin
}).then(res => {
ext = res.headers['content-type']?.split('/')?.pop() || 'png'
return res.data
return res
})
const filename = `${Date.now()}.${ext}`
const filepath = join(tempDir, filename)
Expand Down

0 comments on commit b9a6dd7

Please sign in to comment.