fix: file://中有中文无法正确解析

This commit is contained in:
linyuchen 2024-02-13 19:56:02 +08:00
parent 1936671cb3
commit b28b812396
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,7 @@
"name": "LLOneBot",
"slug": "LLOneBot",
"description": "LiteLoaderQQNT的OneBotApi",
"version": "3.0.2",
"version": "3.0.3",
"thumbnail": "./icon.png",
"authors": [{
"name": "linyuchen",

View File

@ -39,11 +39,12 @@ export async function uri2local(fileName: string, uri: string){
}
} else if (url.protocol === "file:"){
// await fs.copyFile(url.pathname, filePath);
let pathname = decodeURIComponent(url.pathname)
if (process.platform === "win32"){
filePath = url.pathname.slice(1)
filePath = pathname.slice(1)
}
else{
filePath = url.pathname
filePath = pathname
}
res.isLocal = true
}