Skip to content

Commit

Permalink
fix: 使用 JSON RPC 时,出现特殊字符时推送失败的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingyya authored Aug 8, 2024
1 parent 2c282ec commit e138d45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/Parsed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const onWorkerMessage = async (m: WorkerResponse) => {
message.warn(`${m!!.body!!.filename} 下载失败,请刷新页面后重试!`);
return;
}
const rootDir = file.path.replace(new RegExp(`/${rndDir.value}.*`, 'g'), '');
const rootDir = file.path.replace(new RegExp(`/${rndDir.value.replace(/[\[\]]/g, '\\$&')}.*`, 'g'), '');
sendToRPC(m!!.body!!.dlink, m!!.body!!.filename, file.path.replace(new RegExp(`^${rootDir}`), '').replace(m!!.body!!.filename, ''));
return;
}
Expand Down

0 comments on commit e138d45

Please sign in to comment.