mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: 发送文件路径包含#%时发送失败
This commit is contained in:
parent
f7926c2e1b
commit
7ad384d407
@ -122,8 +122,11 @@ export async function uri2local(ctx: Context, uri: string, needExt?: boolean): P
|
|||||||
const { type } = checkUriType(uri)
|
const { type } = checkUriType(uri)
|
||||||
|
|
||||||
if (type === FileUriType.FileURL) {
|
if (type === FileUriType.FileURL) {
|
||||||
const filePath = fileURLToPath(uri)
|
const fileUri = uri.replace('%', '%25').replace('#', '%23')
|
||||||
|
const filePath = fileURLToPath(fileUri)
|
||||||
const fileName = path.basename(filePath)
|
const fileName = path.basename(filePath)
|
||||||
|
// console.log('fileURLToPath', filePath)
|
||||||
|
// console.log('fileName', fileName)
|
||||||
return { success: true, errMsg: '', fileName, path: filePath, isLocal: true }
|
return { success: true, errMsg: '', fileName, path: filePath, isLocal: true }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user