diff --git a/src/admin/templets/sys_safetest.htm b/src/admin/templets/sys_safetest.htm index 859857ab..fdb2f726 100644 --- a/src/admin/templets/sys_safetest.htm +++ b/src/admin/templets/sys_safetest.htm @@ -15,39 +15,37 @@ var filetype = $Obj('filetype').value; var info = $Obj('info').value; $Obj('loaddiv').style.display = 'block'; - fetch('sys_safetest.php?action=test&filetype=' + filetype + "&info=" + info).then(resp=>{ - if (resp.ok) { - return resp.text() - } - throw new Error('系统错误,无法获取数据'); - }).then((d)=>{ - $DE('messagetd').innerHTML = d; - $Obj('loaddiv').style.display = 'none'; - }).catch((error) => { - console.log(error); - }); + if (resp.ok) { + return resp.text() + } + throw new Error('系统错误,无法获取数据'); + }).then((d)=>{ + $DE('messagetd').innerHTML = d; + $Obj('loaddiv').style.display = 'none'; + }).catch((error) => { + console.log(error); + }); } function LoadCtClear() { $Obj('loaddiv').style.display = 'block'; - fetch('sys_safetest.php?action=clear').then(resp=>{ - if (resp.ok) { - return resp.text() - } - throw new Error('系统错误,无法获取数据'); - }).then((d)=>{ - $DE('messagetd').innerHTML = d; - $Obj('loaddiv').style.display = 'none'; - }).catch((error) => { - $DE('messagetd').innerHTML = errMsg; - }); + if (resp.ok) { + return resp.text() + } + throw new Error('系统错误,无法获取数据'); + }).then((d)=>{ + $DE('messagetd').innerHTML = d; + $Obj('loaddiv').style.display = 'none'; + }).catch((error) => { + $DE('messagetd').innerHTML = errMsg; + }); } -