From 27d2dfe293bf3ab4e64ddb1792e5ed4f578782a2 Mon Sep 17 00:00:00 2001 From: wangbing <1919101440@qq.com> Date: Thu, 16 Jan 2020 23:55:01 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81eldialog=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 3d47b8b278a3ccd74516e82d073b722f9e16d39f --- .../resources/templates/control/nav.ftl | 40 ++++++++--- .../resources/templates/screen/index.ftl | 24 ++++--- .../resources/templates/screen/login.ftl | 68 +++++++------------ 3 files changed, 68 insertions(+), 64 deletions(-) diff --git a/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl b/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl index 8d767b72..00eac0b6 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl @@ -229,7 +229,7 @@ var mixin = { data: { activeIndex: 'home', - contextPath: '${context?default("")}', + context: '${context?default("")}', homePath: '${home?default("")}', isSubmit: false, result: [], @@ -402,6 +402,8 @@ data: { loadingTip: '', loadingBar: '', + context: '${context?default("")}', + homePath: '${home?default("")}' }, methods: { tipShow: function (msg) { @@ -500,23 +502,21 @@ toOpen: function (url) { this.tipShow(); var url = url.substring(0, 1) == "/" ? url.substring(1) : url; - $("body").append($("")) + $("body").append($("")) document.getElementById("wb-open").click(); $("#wb-open").remove(); }, toOpenNew: function (url) { var url = url.substring(0, 1) == "/" ? url.substring(1) : url; - $("body").append($("")) + $("body").append($("")) document.getElementById("wb-open").click(); $("#wb-open").remove(); }, toHome: function () { this.tipShow(); - location.href = this.contextPath + "/" + location.href = this.context + "/" }, - /** - * 滚动屏蔽至顶部 - */ + // 滚动屏蔽至顶部 scrollToTop: function () { var distance = document.documentElement.scrollTop || document.body.scrollTop; var step = distance / 10; @@ -529,10 +529,7 @@ } })(); }, - /** - * 控制任一目标滚动到顶部 - * select jquery对象 - */ + // 控制任一目标滚动到顶部 scrollToTop: function (select) { var distance = $(select).scrollTop(); var step = distance / 10; @@ -576,6 +573,27 @@ wscript.SendKeys("{F11}"); } } + }, + setCookie:function (name, value, expiretime) { + var exdate = new Date(); + exdate.setDate(exdate.getTime() + expiretime); + document.cookie = name + "=" + encodeURIComponent(value) + ";expires=" + exdate.toGMTString() + ";path=/"; + }, + getCookie:function (name) { + if (document.cookie.length > 0) { + c_start = document.cookie.indexOf(name + "=") + if (c_start != -1){ + c_start = c_start + name.length + 1 + c_end = document.cookie.indexOf(";", c_start) + if (c_end == -1) + c_end = document.cookie.length + return decodeURIComponent(document.cookie.substring(c_start, c_end)) + } + } + return "" + }, + clearCookie:function (name) { + this.setCookie(name, "", -1); } } }); diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl index 7a6aec8c..b3fea387 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl @@ -54,13 +54,6 @@