From 8d58e5d06c7c07bc0fc3fdc52b0fb27c8e2e633a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=9D=B0?= Date: Thu, 20 Sep 2018 13:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=88=B7=E6=96=B0=E5=90=8E=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E7=9A=84bug,=E4=BF=AE=E5=A4=8D=E4=B8=BB=E9=A2=98=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/common/setting.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/resources/templates/common/setting.html b/src/main/resources/templates/common/setting.html index 44aa25b..c10e33c 100644 --- a/src/main/resources/templates/common/setting.html +++ b/src/main/resources/templates/common/setting.html @@ -159,12 +159,17 @@ */ var themeKey = 'KITADMIN_SETTING_THEME'; var theme = localStorage.getItem(themeKey); - var themeName = $.parseJSON(theme).theme; - $("input[name='setting-theme']").each(function () { - if($(this).parent().attr("data-theme") == themeName){ - $(this).attr("checked","checked"); - } - }) + + if(theme == null){ + $("input[name='setting-theme']")[0].attr("checked","checked"); + } else { + var themeName = $.parseJSON(theme).theme; + $("input[name='setting-theme']").each(function () { + if($(this).parent().attr("data-theme") == themeName){ + $(this).attr("checked","checked"); + } + }) + } layui.use(['form', 'utils'], function () { var form = layui.form, $ = layui.jquery,