多语言翻译

master
erzhongxmu 2022-10-15 19:53:32 +08:00
parent 0a946f4aa5
commit 777f467529
1 changed files with 325 additions and 309 deletions

View File

@ -1,35 +1,35 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@page import="org.jeecgframework.core.util.SysThemesUtil,org.jeecgframework.core.enums.SysThemesEnum"%> <%@page import="org.jeecgframework.core.util.SysThemesUtil,org.jeecgframework.core.enums.SysThemesEnum" %>
<%@include file="/context/mytags.jsp"%> <%@include file="/context/mytags.jsp" %>
<% <%
session.setAttribute("lang","zh-cn"); session.setAttribute("lang", "zh-cn");
SysThemesEnum sysTheme = SysThemesUtil.getSysTheme(request); SysThemesEnum sysTheme = SysThemesUtil.getSysTheme(request);
String lhgdialogTheme = SysThemesUtil.getLhgdialogTheme(sysTheme); String lhgdialogTheme = SysThemesUtil.getLhgdialogTheme(sysTheme);
%> %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta charset="utf-8" /> <meta charset="utf-8"/>
<title><t:mutiLang langKey="jeect.platform"/></title> <title><t:mutiLang langKey="jeect.platform"/></title>
<link rel="shortcut icon" href="images/favicon.ico"> <link rel="shortcut icon" href="images/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<!-- bootstrap & fontawesome --> <!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="plug-in/ace/css/bootstrap.css" /> <link rel="stylesheet" href="plug-in/ace/css/bootstrap.css"/>
<link rel="stylesheet" href="plug-in/ace/css/font-awesome.css" /> <link rel="stylesheet" href="plug-in/ace/css/font-awesome.css"/>
<link rel="stylesheet" type="text/css" href="plug-in/accordion/css/accordion.css"> <link rel="stylesheet" type="text/css" href="plug-in/accordion/css/accordion.css">
<!-- text fonts --> <!-- text fonts -->
<link rel="stylesheet" href="plug-in/ace/css/ace-fonts.css" /> <link rel="stylesheet" href="plug-in/ace/css/ace-fonts.css"/>
<link rel="stylesheet" href="plug-in/ace/css/jquery-ui.css" /> <link rel="stylesheet" href="plug-in/ace/css/jquery-ui.css"/>
<!-- ace styles --> <!-- ace styles -->
<link rel="stylesheet" href="plug-in/ace/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" /> <link rel="stylesheet" href="plug-in/ace/css/ace.css" class="ace-main-stylesheet" id="main-ace-style"/>
<!--[if lte IE 9]> <!--[if lte IE 9]>
<link rel="stylesheet" href="plug-in/ace/css/ace-part2.css" class="ace-main-stylesheet" /> <link rel="stylesheet" href="plug-in/ace/css/ace-part2.css" class="ace-main-stylesheet"/>
<![endif]--> <![endif]-->
<!--[if lte IE 9]> <!--[if lte IE 9]>
<link rel="stylesheet" href="plug-in/ace/css/ace-ie.css" /> <link rel="stylesheet" href="plug-in/ace/css/ace-ie.css"/>
<![endif]--> <![endif]-->
<!-- ace settings handler --> <!-- ace settings handler -->
<script src="plug-in/ace/js/ace-extra.js"></script> <script src="plug-in/ace/js/ace-extra.js"></script>
@ -50,19 +50,22 @@
<div class="login-container"> <div class="login-container">
<div class="center"> <div class="center">
<h1 id="id-text2" class="grey"> <h1 id="id-text2" class="grey">
<!-- <i class="ace-icon fa fa-leaf green"></i> --> <!-- <i class="ace-icon fa fa-leaf green"></i> -->
<t:mutiLang langKey="com.sysname"/> <t:mutiLang langKey="com.sysname"/>
</h1> </h1>
<!-- <h4 class="blue" id="id-company-text">www.zzjee.org</h4> --> <!-- <h4 class="blue" id="id-company-text">www.zzjee.org</h4> -->
</div> </div>
<div class="space-6"></div> <div class="space-6"></div>
<div class="position-relative"> <div class="position-relative">
<div id="login-box" class="login-box visible widget-box no-border"> <div id="login-box" class="login-box visible widget-box no-border">
<div class="widget-body"> <div class="widget-body">
<form id="loinForm" class="form-horizontal" check="loginController.do?checkuser" role="form" action="loginController.do?login" method="post"> <form id="loinForm" class="form-horizontal" check="loginController.do?checkuser"
role="form" action="loginController.do?login" method="post">
<div class="widget-main"> <div class="widget-main">
<div class="alert alert-warning alert-dismissible" role="alert" id="errMsgContiner"> <div class="alert alert-warning alert-dismissible" role="alert"
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> id="errMsgContiner">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<div id="showErrMsg"></div> <div id="showErrMsg"></div>
</div> </div>
<h4 class="header blue lighter bigger"> <h4 class="header blue lighter bigger">
@ -74,34 +77,40 @@
<div class="space-6"></div> <div class="space-6"></div>
<label class="block clearfix"> <label class="block clearfix">
<span class="block input-icon input-icon-right"> <span class="block input-icon input-icon-right">
<input type="text" name="userName" class="form-control" id="userName" value="admin"/> <input type="text" name="userName" class="form-control" id="userName"
value="admin"/>
<i class="ace-icon fa fa-user"></i> <i class="ace-icon fa fa-user"></i>
</span> </span>
</label> </label>
<label class="block clearfix"> <label class="block clearfix">
<span class="block input-icon input-icon-right"> <span class="block input-icon input-icon-right">
<input type="password" name="password" class="form-control" id="password" value="llg123"/> <input type="password" name="password" class="form-control" id="password"
value="llg123"/>
<i class="ace-icon fa fa-lock"></i> <i class="ace-icon fa fa-lock"></i>
</span> </span>
</label> </label>
<label class="block clearfix"> <label class="block clearfix">
<div class="input-group"> <div class="input-group">
<input type="text" style="width:150px" name="randCode" class="form-control" id="randCode"/> <input type="text" style="width:150px" name="randCode"
<span class="input-group-addon" style="padding: 0px;"><img id="randCodeImage" src="randCodeImage" /></span> class="form-control" id="randCode"/>
<span class="input-group-addon" style="padding: 0px;"><img
id="randCodeImage" src="randCodeImage"/></span>
</div> </div>
</label> </label>
<div class="space"></div> <div class="space"></div>
<div class="clearfix"> <div class="clearfix">
<label class="inline"> <label class="inline">
<input type="checkbox" class="ace" id="on_off" name="remember" value="yes"/> <input type="checkbox" class="ace" id="on_off" name="remember"
value="yes"/>
<span class="lbl"> <span class="lbl">
<t:mutiLang langKey="login.saveusername"/> <t:mutiLang langKey="login.saveusername"/>
</span> </span>
</label> </label>
<button type="button" id="but_login" onclick="checkUser()" class="width-35 pull-right btn btn-sm btn-primary"> <button type="button" id="but_login" onclick="checkUser()"
class="width-35 pull-right btn btn-sm btn-primary">
<i class="ace-icon fa fa-key"></i> <i class="ace-icon fa fa-key"></i>
<span class="bigger-110" > <span class="bigger-110">
<t:mutiLang langKey="login.login"/> <t:mutiLang langKey="login.login"/>
</span> </span>
@ -115,16 +124,19 @@
<a href="#" class="forgot-password-link"> <a href="#" class="forgot-password-link">
语言 语言
<i class="ace-icon fa fa-arrow-right"></i> <i class="ace-icon fa fa-arrow-right"></i>
<t:dictSelect id="langCode" field="langCode" typeGroupCode="lang" hasLabel="false" extendJson="{style:'padding:2px; width:80px;'}" defaultVal="zh-cn"></t:dictSelect> <t:dictSelect id="langCode" field="langCode" typeGroupCode="lang"
hasLabel="false"
extendJson="{style:'padding:2px; width:80px;'}"
defaultVal="zh-cn"></t:dictSelect>
</a> </a>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<%-- <div class="center"><h4 class="blue" id="id-company-text">&copy; 本系统未在任何平台出售源码版权归jeewms所有如果需要服务请联系13850081872</h4></div>--%> <%-- <div class="center"><h4 class="blue" id="id-company-text">&copy; 本系统未在任何平台出售源码版权归jeewms所有如果需要服务请联系13850081872</h4></div>--%>
<div class="navbar-fixed-top align-right"> <div class="navbar-fixed-top align-right">
<br /> <br/>
&nbsp; &nbsp;
<a id="btn-login-dark" class="blue" href="#" onclick="darkStyle()">Dark</a> <a id="btn-login-dark" class="blue" href="#" onclick="darkStyle()">Dark</a>
&nbsp; &nbsp;
@ -142,8 +154,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.min.js"></script>
@ -154,42 +165,44 @@
<script type="text/javascript" src="plug-in/login/js/iphone.check.js"></script> <script type="text/javascript" src="plug-in/login/js/iphone.check.js"></script>
<script type="text/javascript" src="plug-in/login/js/login.js"></script> <script type="text/javascript" src="plug-in/login/js/login.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function () {
optErrMsg(); optErrMsg();
}); });
$("#errMsgContiner").hide(); $("#errMsgContiner").hide();
function optErrMsg(){
function optErrMsg() {
$("#showErrMsg").html(''); $("#showErrMsg").html('');
$("#errMsgContiner").hide(); $("#errMsgContiner").hide();
} }
//输入验证码,回车登录 //输入验证码,回车登录
$(document).keydown(function(e){ $(document).keydown(function (e) {
if(e.keyCode == 13) { if (e.keyCode == 13) {
$("#but_login").click(); $("#but_login").click();
} }
}); });
//验证用户信息 //验证用户信息
function checkUser(){ function checkUser() {
if(!validForm()){ if (!validForm()) {
return false; return false;
} }
newLogin(); newLogin();
} }
//表单验证 //表单验证
function validForm(){ function validForm() {
if($.trim($("#userName").val()).length==0){ if ($.trim($("#userName").val()).length == 0) {
showErrorMsg("请输入用户名"); showErrorMsg("请输入用户名");
return false; return false;
} }
if($.trim($("#password").val()).length==0){ if ($.trim($("#password").val()).length == 0) {
showErrorMsg("请输入密码"); showErrorMsg("请输入密码");
return false; return false;
} }
if($.trim($("#randCode").val()).length==0){ if ($.trim($("#randCode").val()).length == 0) {
showErrorMsg("请输入验证码"); showErrorMsg("请输入验证码");
return false; return false;
} }
@ -199,31 +212,31 @@
//登录处理函数 //登录处理函数
function newLogin(orgId) { function newLogin(orgId) {
setCookie(); setCookie();
var actionurl=$('form').attr('action');//提交路径 var actionurl = $('form').attr('action');//提交路径
var checkurl=$('form').attr('check');//验证路径 var checkurl = $('form').attr('check');//验证路径
var formData = new Object(); var formData = new Object();
var data=$(":input").each(function() { var data = $(":input").each(function () {
formData[this.name] =$("#"+this.name ).val(); formData[this.name] = $("#" + this.name).val();
}); });
formData['orgId'] = orgId ? orgId : ""; formData['orgId'] = orgId ? orgId : "";
//语言 //语言
formData['langCode']=$("#langCode").val(); formData['langCode'] = $("#langCode").val();
formData['langCode'] = $("#langCode option:selected").val(); formData['langCode'] = $("#langCode option:selected").val();
$.ajax({ $.ajax({
async : false, async: false,
cache : false, cache: false,
type : 'POST', type: 'POST',
url : checkurl,// 请求的action路径 url: checkurl,// 请求的action路径
data : formData, data: formData,
error : function() {// 请求失败处理函数 error: function () {// 请求失败处理函数
}, },
success : function(data) { success: function (data) {
var d = $.parseJSON(data); var d = $.parseJSON(data);
if (d.success) { if (d.success) {
if (d.attributes.orgNum > 1) { if (d.attributes.orgNum > 1) {
//用户拥有多个部门,需选择部门进行登录 //用户拥有多个部门,需选择部门进行登录
var title, okButton; var title, okButton;
if($("#langCode").val() == 'en') { if ($("#langCode").val() == 'en') {
title = "Please select Org"; title = "Please select Org";
okButton = "Ok"; okButton = "Ok";
} else { } else {
@ -238,24 +251,24 @@
drag: false, drag: false,
resize: false, resize: false,
content: 'url:userController.do?userOrgSelect&userId=' + d.attributes.user.id, content: 'url:userController.do?userOrgSelect&userId=' + d.attributes.user.id,
lock:true, lock: true,
button : [ { button: [{
name : okButton, name: okButton,
focus : true, focus: true,
callback : function() { callback: function () {
iframe = this.iframe.contentWindow; iframe = this.iframe.contentWindow;
var orgId = $('#orgId', iframe.document).val(); var orgId = $('#orgId', iframe.document).val();
formData['orgId'] = orgId ? orgId : ""; formData['orgId'] = orgId ? orgId : "";
$.ajax({ $.ajax({
async : false, async: false,
cache : false, cache: false,
type : 'POST', type: 'POST',
url : 'loginController.do?changeDefaultOrg',// 请求的action路径 url: 'loginController.do?changeDefaultOrg',// 请求的action路径
data : formData, data: formData,
error : function() {// 请求失败处理函数 error: function () {// 请求失败处理函数
}, },
success : function(data) { success: function (data) {
window.location.href = actionurl; window.location.href = actionurl;
} }
}); });
@ -264,8 +277,8 @@
return false; return false;
} }
}], }],
close: function(){ close: function () {
setTimeout("window.location.href='"+actionurl+"'", 10); setTimeout("window.location.href='" + actionurl + "'", 10);
} }
}); });
} else { } else {
@ -273,74 +286,79 @@
} }
} else { } else {
showErrorMsg(d.msg); showErrorMsg(d.msg);
if(d.msg === "用户名或密码错误" || d.msg === "验证码错误") if (d.msg === "用户名或密码错误" || d.msg === "验证码错误")
reloadRandCodeImage(); reloadRandCodeImage();
} }
} }
}); });
} }
//登录提示消息显示 //登录提示消息显示
function showErrorMsg(msg){ function showErrorMsg(msg) {
$("#errMsgContiner").show(); $("#errMsgContiner").show();
$("#showErrMsg").html(msg); $("#showErrMsg").html(msg);
window.setTimeout(optErrMsg,3000); window.setTimeout(optErrMsg, 3000);
} }
/** /**
* 刷新验证码 * 刷新验证码
*/ */
$('#randCodeImage').click(function(){ $('#randCodeImage').click(function () {
reloadRandCodeImage(); reloadRandCodeImage();
}); });
function reloadRandCodeImage() {
function reloadRandCodeImage() {
var date = new Date(); var date = new Date();
var img = document.getElementById("randCodeImage"); var img = document.getElementById("randCodeImage");
img.src='randCodeImage?a=' + date.getTime(); img.src = 'randCodeImage?a=' + date.getTime();
} }
function darkStyle(){ function darkStyle() {
$('body').attr('class', 'login-layout'); $('body').attr('class', 'login-layout');
$('#id-text2').attr('class', 'red'); $('#id-text2').attr('class', 'red');
$('#id-company-text').attr('class', 'blue'); $('#id-company-text').attr('class', 'blue');
e.preventDefault(); e.preventDefault();
} }
function lightStyle(){
function lightStyle() {
$('body').attr('class', 'login-layout light-login'); $('body').attr('class', 'login-layout light-login');
$('#id-text2').attr('class', 'grey'); $('#id-text2').attr('class', 'grey');
$('#id-company-text').attr('class', 'blue'); $('#id-company-text').attr('class', 'blue');
e.preventDefault(); e.preventDefault();
} }
function blurStyle(){
function blurStyle() {
$('body').attr('class', 'login-layout blur-login'); $('body').attr('class', 'login-layout blur-login');
$('#id-text2').attr('class', 'white'); $('#id-text2').attr('class', 'white');
$('#id-company-text').attr('class', 'light-blue'); $('#id-company-text').attr('class', 'light-blue');
e.preventDefault(); e.preventDefault();
} }
//设置cookie
function setCookie() //设置cookie
{ function setCookie() {
if ($('#on_off').val() == '1') { if ($('#on_off').val() == '1') {
$("input[iscookie='true']").each(function() { $("input[iscookie='true']").each(function () {
$.cookie(this.name, $("#"+this.name).val(), "/",24); $.cookie(this.name, $("#" + this.name).val(), "/", 24);
$.cookie("COOKIE_NAME","true", "/",24); $.cookie("COOKIE_NAME", "true", "/", 24);
}); });
} else { } else {
$("input[iscookie='true']").each(function() { $("input[iscookie='true']").each(function () {
$.cookie(this.name,null); $.cookie(this.name, null);
$.cookie("COOKIE_NAME",null); $.cookie("COOKIE_NAME", null);
}); });
} }
} }
//读取cookie //读取cookie
function getCookie() function getCookie() {
{ var COOKIE_NAME = $.cookie("COOKIE_NAME");
var COOKIE_NAME=$.cookie("COOKIE_NAME"); if (COOKIE_NAME != null) {
if (COOKIE_NAME !=null) { $("input[iscookie='true']").each(function () {
$("input[iscookie='true']").each(function() { $($("#" + this.name).val($.cookie(this.name)));
$($("#"+this.name).val( $.cookie(this.name))); if ("admin" == $.cookie(this.name)) {
if("admin" == $.cookie(this.name)) {
$("#randCode").focus(); $("#randCode").focus();
} else { } else {
$("#password").val(""); $("#password").val("");
@ -349,9 +367,7 @@ function reloadRandCodeImage() {
}); });
$("#on_off").attr("checked", true); $("#on_off").attr("checked", true);
$("#on_off").val("1"); $("#on_off").val("1");
} } else {
else
{
$("#on_off").attr("checked", false); $("#on_off").attr("checked", false);
$("#on_off").val("0"); $("#on_off").val("0");
$("#randCode").focus(); $("#randCode").focus();