From 6b2ff250be945106324d403889d50bf9d6758d7e Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Wed, 1 Sep 2021 22:52:17 +0800 Subject: [PATCH] Fix decompressFromBase64 --- libs/control.js | 3 ++- libs/utils.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/control.js b/libs/control.js index 9b91e070..8f2d8a17 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2173,7 +2173,8 @@ control.prototype._syncLoad_http = function (id, password) { var msg = null; try { msg = JSON.parse(LZString.decompressFromBase64(response.msg)); - } catch (e) { + } catch (e) {} + if (!msg) { try { msg = JSON.parse(response.msg); } catch (e) {} diff --git a/libs/utils.js b/libs/utils.js index 38c4598b..22b04674 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -1030,7 +1030,8 @@ utils.prototype.readFileContent = function (content) { // 检查base64 try { obj = JSON.parse(LZString.decompressFromBase64(content)); - } catch (e) { + } catch (e) {} + if (!obj) { try { obj = JSON.parse(content); } catch (e) {