mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-17 01:40:44 +08:00
🐛 添加 shareurl 解码的错误处理
- 添加try-catch块以处理decodeURIComponent函数中的潜在错误
This commit is contained in:
parent
7d8701db0a
commit
c90262485f
@ -524,11 +524,16 @@
|
||||
changeShareurl(task) {
|
||||
if (!task.shareurl)
|
||||
return;
|
||||
this.$set(task, "shareurl_ban", undefined);
|
||||
// 从URL中提取任务名
|
||||
const matches = decodeURIComponent(task.shareurl).match(/\/(\w{32})-([^\/]+)$/);
|
||||
if (matches) {
|
||||
task.taskname = task.taskname == "" ? matches[2] : task.taskname;
|
||||
task.savepath = task.savepath.replace(/TASKNAME/g, matches[2]);
|
||||
try {
|
||||
const matches = decodeURIComponent(task.shareurl).match(/\/(\w{32})-([^\/]+)$/);
|
||||
if (matches) {
|
||||
task.taskname = task.taskname == "" ? matches[2] : task.taskname;
|
||||
task.savepath = task.savepath.replace(/TASKNAME/g, matches[2]);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Error decodeURIComponent:", e);
|
||||
}
|
||||
// 从分享中提取任务名
|
||||
axios.get('/get_share_detail', { params: { shareurl: task.shareurl } })
|
||||
|
||||
Loading…
Reference in New Issue
Block a user