Skip to content

Commit 3fb819d

Browse files
committed
fix: 修复参数解析错误时未添加引号的问题
当参数解析失败时,确保将原始参数文本用引号包裹,避免后续处理错误
1 parent 79e6138 commit 3fb819d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ <h3 id="modalTitle">添加任务</h3>
10271027
try {
10281028
params = paramsText ? JSON.parse(paramsText) : {};
10291029
} catch (e) {
1030-
params = paramsText
1030+
params = `"${paramsText}"`
10311031
}
10321032

10331033
executeBtn.disabled = true;
@@ -1094,7 +1094,12 @@ <h3 id="modalTitle">添加任务</h3>
10941094

10951095
// 保存调试结果
10961096
const methodName = document.getElementById('methodSelect').value;
1097-
const params = JSON.parse(document.getElementById('paramsInput').value);
1097+
let params
1098+
try{
1099+
params = JSON.parse(document.getElementById('paramsInput').value);
1100+
}catch(e){
1101+
params = `"${document.getElementById('paramsInput').value}"`;
1102+
}
10981103
debugResults.push({
10991104
timestamp: new Date().toISOString(),
11001105
method: methodName,

0 commit comments

Comments
 (0)