fix JSON parse empty string

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-06-20 18:15:54 +08:00
parent 42798870c1
commit 0450eb51a1

View File

@ -427,7 +427,7 @@ function httpRequest(url, type, params, _onSuccess, _onError, headers="") {
if (status == " ") self.timer(0.1s, check_status); if (status == " ") self.timer(0.1s, check_status);
else { else {
try { try {
var data = JSON.parse(status); var data = JSON.parse(status || "{}");
_onSuccess(data); _onSuccess(data);
} catch (e) { } catch (e) {
_onError(status, 0); _onError(status, 0);