mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🐛 修复帖子内图片无法保存到本地
This commit is contained in:
@@ -33,7 +33,7 @@ export async function saveCanvasImg(
|
||||
const res = await save({
|
||||
title: "保存图片",
|
||||
filters: [{ name: "图片", extensions: [format] }],
|
||||
defaultPath: `${await path.downloadDir()}${path.sep}${filename}.${format}`,
|
||||
defaultPath: `${await path.downloadDir()}${path.sep()}${filename}.${format}`,
|
||||
});
|
||||
if (res === null) {
|
||||
await TGLogger.Info(`[saveCanvasImg][${filename}] 未选择保存路径`);
|
||||
@@ -63,7 +63,7 @@ export async function saveImgLocal(url: string): Promise<string> {
|
||||
* @returns {Promise<Uint8Array>} 图片 buffer
|
||||
*/
|
||||
export async function getImageBuffer(url: string): Promise<Uint8Array> {
|
||||
const res = await TGHttp<Uint8Array>(url, { method: "GET" });
|
||||
const res = await TGHttp<Uint8Array>(url, { method: "GET", isBlob: true });
|
||||
return new Uint8Array(res);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user