From 9c5db77a65ed601ef6fbb52e3d74d7b024a676e2 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Sat, 15 Feb 2025 16:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=E4=B8=8D=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E9=BB=98=E8=AE=A4=E5=BD=93=E5=89=8D=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeesite/common/shiro/filter/FormFilter.java | 2 +- .../views/include/sysIndex/topMenuOffice.html | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/core/src/main/java/com/jeesite/common/shiro/filter/FormFilter.java b/modules/core/src/main/java/com/jeesite/common/shiro/filter/FormFilter.java index 3eaadd7c..b983e44e 100644 --- a/modules/core/src/main/java/com/jeesite/common/shiro/filter/FormFilter.java +++ b/modules/core/src/main/java/com/jeesite/common/shiro/filter/FormFilter.java @@ -497,7 +497,7 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica } if (SWITCH_OFFICE && User.USER_TYPE_EMPLOYEE.equals(user.getUserType())) { data.put("switchOffice", "true"); - data.put("officeCode", EmpUtils.getCurrentOfficeCode()); + data.put("officeCode", session.getAttribute("officeCode")); data.put("officeName", EmpUtils.getCurrentOfficeName()); } data.put("desktopUrl", desktopUrl != null ? desktopUrl : Global.getConfig("sys.index.desktopUrl")); diff --git a/modules/core/src/main/resources/views/include/sysIndex/topMenuOffice.html b/modules/core/src/main/resources/views/include/sysIndex/topMenuOffice.html index 316024ca..b3dac4d6 100644 --- a/modules/core/src/main/resources/views/include/sysIndex/topMenuOffice.html +++ b/modules/core/src/main/resources/views/include/sysIndex/topMenuOffice.html @@ -3,7 +3,7 @@ ${officeName!} -
<#form:treeselect id="switchOfficeSelect" title="${text('部门切换')}" allowClear="false" +
<#form:treeselect id="switchOfficeSelect" title="${text('部门切换')}" allowClear="true" url="${ctx}/sys/empUser/officeListData?isShowCode=true" callbackFuncName="switchOfficeSelectCallback" fieldNames="{'id':'officeCode','name':'fullName'}"/>
@@ -12,14 +12,12 @@ $('#switchOfficeSelectButton').click(); }); function switchOfficeSelectCallback(id, act, index, layero, nodes){ - if (act == 'ok'){ + if (act == 'ok' || act == 'clear'){ var officeCode = $('#switchOfficeSelectCode').val(); - if (officeCode != ''){ - js.ajaxSubmit("${ctx}/sys/empUser/switchOffice/"+officeCode, function(data){ - js.showMessage(data.message); - js.window.location.reload(); - }); - } + js.ajaxSubmit("${ctx}/sys/empUser/switchOffice" + (officeCode != '' ? "/"+officeCode : ""), function(data){ + js.showMessage(data.message); + js.window.location.reload(); + }); } }