新增用户界面的时区切换

This commit is contained in:
thinkgem
2025-05-26 09:42:59 +08:00
parent 9118907838
commit 3c295c86b8
2 changed files with 17 additions and 1 deletions

View File

@@ -431,6 +431,8 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
data.put("company", Global.getProperty("companyName"));
data.put("version", Global.getProperty("productVersion"));
data.put("year", Global.getProperty("copyrightYear"));
data.put("lang", Global.getLang(request));
data.put("timeZone", Global.getTimeZone(request));
}
/**
@@ -458,7 +460,8 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
data.put("company", Global.getProperty("companyName"));
data.put("version", Global.getProperty("productVersion"));
data.put("year", Global.getProperty("copyrightYear"));
data.put("lang", Global.getLang());
data.put("lang", Global.getLang(request));
data.put("timeZone", Global.getTimeZone(request));
List<Map<String, Object>> roleList = ListUtils.newArrayList();
String desktopUrl = null; String roleCode = (String)session.getAttribute("roleCode");
Set<String> roleCodes = roleCode != null ? SetUtils.newHashSet(StringUtils.splitComma(roleCode)) : null;

View File

@@ -8,6 +8,19 @@
<% for(var dict in @DictUtils.getDictList('sys_lang_type')){ %>
<li><a href="${ctxPath}/lang/${dict.dictValue}" onclick="location=this.href+'?url='+location.href;return false;">${dict.dictLabel}</a></li>
<% } %>
<li><a href="javascript:$('#timeZoneSelectName').click()">${@Global.getTimeZone()}</a></li>
<div class="hide">
<#form:treeselect id="timeZoneSelect" title="${text('时区选择')}" allowClear="false"
url="${ctxPath}/timeZone/treeData" callbackFuncName="timeZoneSelectCallback" boxWidth="350"/>
<script>
function timeZoneSelectCallback(id, act){
if (id == 'timeZoneSelect' && (act == 'ok')){
var timeZoneId = $('#timeZoneSelectCode').val();
location = '${ctxPath}/timeZone?id=' + js.encodeUrl(timeZoneId) + '&url=' + location.href;
}
}
</script>
</div>
<li class="mt10"></li>
</ul>
</li>