From fb0f5be2ef5fe16099a2685031b3502635d2aebf Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 9 Aug 2022 09:50:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=97=E5=85=B8=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E8=8E=B7=E5=8F=96=E5=AD=97=E5=85=B8=E7=9A=84=E5=8F=96?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/dict.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/dict.js b/src/common/dict.js index af917c00..f06099ef 100644 --- a/src/common/dict.js +++ b/src/common/dict.js @@ -9,11 +9,13 @@ const $dict = { this.url = config?.url || this.url }, dicts() { - return uni.getStorageSync('dicts') || []; + let dicts = uni.getStorageSync('dicts') + typeof dicts == "string" ? (dicts = JSON.parse(dicts)) : dicts + return dicts || []; }, load(...code) { return this.instance && this.instance.post(this.url, null, { - withoutToken:true, + withoutToken: true, params: { codeList: code.toString() }