diff --git a/gloam/WebRoot/i18n/globalMessages_en_US.properties b/gloam/WebRoot/i18n/globalMessages_en_US.properties index 9856ad9..3747b17 100644 --- a/gloam/WebRoot/i18n/globalMessages_en_US.properties +++ b/gloam/WebRoot/i18n/globalMessages_en_US.properties @@ -5254,7 +5254,7 @@ xt_mk_jbxx.285.mkmc=Business Logic Topology xt_yh_jbxx.admin.rigthmenuitems=System Management, xt_yh_jbxx.admin.yhmc=Administrator -####################补充内容 start############################## +####################补充内容 start############################## #xt_mk_jbxx #Mon May 28 11:27:21 CST 2018 xt_mk_jbxx.221.mkmc=Brand Management @@ -5376,7 +5376,7 @@ data_police_relation.100000.POLICE_SHOW_INFO=User usage exceeds 2% #order_table #Mon May 28 16:25:52 CST 2018 order_table.upgrade_recover.shell_path=Change the command name to upgrade_restore -####################补充内容 end############################## +####################补充内容 end############################## #DeptManageAction DeptManageAction.update.success=Operation successful @@ -6882,18 +6882,18 @@ client.Sysconfig.init=Lack of configuration file, program cannot be executed! \n client.Sysconfig.error=Error client.AlarmThread.processExists=process exists, but -client.AlarmThread.loopMission1=The scheduled task“ -client.AlarmThread.loopMission2=”does not exist +client.AlarmThread.loopMission1=The scheduled task“ +client.AlarmThread.loopMission2=”does not exist client.AlarmThread.state=This status lasted client.AlarmThread.times=times -client.AlarmThread.dataFileNotExists1=Data file directory“ -client.AlarmThread.dataFileNotExists2=”does not exist +client.AlarmThread.dataFileNotExists1=Data file directory“ +client.AlarmThread.dataFileNotExists2=”does not exist client.AlarmThread.dataSize=Monitor data file size is 0 client.AlarmThread.noDetecateData=No monitoring data client.StartPluginRun.startupDetecate=Start Tripartite Monitoring -client.StartPluginRun.startupDetecateErr1=Tripartite monitor failed to start. Please check if the process startup file“ -client.StartPluginRun.startupDetecateErr1.isTrue=”is set correctly! +client.StartPluginRun.startupDetecateErr1=Tripartite monitor failed to start. Please check if the process startup file“ +client.StartPluginRun.startupDetecateErr1.isTrue=”is set correctly! client.StartPluginRun.startupDetecateErr2=Initiate tripartite monitoring anomaly and the monitoring script has not been issued! client.StartPluginRun.startupDetecateErr3=Initiate tripartite monitoring anomaly and monitor script execution error! client.ServerCollectData.transFile=Postback Success @@ -7172,11 +7172,11 @@ server.CommonService.errorInfo5=Location {0} Data Monitoring Category cannot be server.CommonService.errorInfo6=Location {0} data ""+startTime+"" monitoring service start time must be integer server.CommonService.errorInfo7=Location {0} data monitoring service startup time cannot be empty server.CommonService.errorInfo8=Location {0} data "{1}" Detection delay (seconds) must be integer -server.CommonService.errorInfo9=Location {0} data “{1}” The detection time must be integer +server.CommonService.errorInfo9=Location {0} data “{1}” The detection time must be integer server.CommonService.errorInfo10=Location {0} Data This test cannot be empty server.CommonService.errorInfo11=Location {0} data "{1}" Attempt must be an integer server.CommonService.errorInfo12=Location {0} data Attempt cannot be empty -server.CommonService.errorInfo13=Location {0} data “{1}” The next scheduled monitoring time must be integer +server.CommonService.errorInfo13=Location {0} data “{1}” The next scheduled monitoring time must be integer server.CommonService.errorInfo14=Location {0} Data Attempt cannot be null server.CommonService.errorInfo15=Location {0} data "{1}" Execution state must be integer server.CommonService.errorInfo16=Location {0} Data Execution state cannot be empty @@ -7197,14 +7197,14 @@ server.CommonService.errorInfo21=Location {0} Data node seqId (Physical Host ID) server.CommonService.errorInfo22=Location {0} Data Monitoring Settings ID cannot be empty server.CommonService.errorInfo23=Location {0} Data Monitoring Settings ID is not an integer (including 0) server.CommonService.errorInfo24=Location {0} Data Monitoring Category cannot be empty -server.CommonService.errorInfo25=Location {0} data “{1}” monitoring service startup time must be integer +server.CommonService.errorInfo25=Location {0} data “{1}” monitoring service startup time must be integer server.CommonService.errorInfo26=Location {0} data monitoring service startup time cannot be empty server.CommonService.errorInfo27=Location {0} data "{1}" Detection delay (seconds) must be integer -server.CommonService.errorInfo28=Location {0} Data “{1}” This detection time must be an integer +server.CommonService.errorInfo28=Location {0} Data “{1}” This detection time must be an integer server.CommonService.errorInfo29=Location {0} Data This test cannot be empty server.CommonService.errorInfo30=Location {0} data "{1}" Attempt must be an integer server.CommonService.errorInfo31=Location {0} data Attempt cannot be empty -server.CommonService.errorInfo32=Location {0} data “{1}” The next scheduled monitoring time must be integer +server.CommonService.errorInfo32=Location {0} data “{1}” The next scheduled monitoring time must be integer server.CommonService.errorInfo33=Location {0} data Attempt cannot be empty server.CommonService.errorInfo34=Location {0} data "{1}" Execution state must be integer server.CommonService.errorInfo35=Location {0} data Execution state cannot be empty @@ -7349,4 +7349,15 @@ procInfoList.text.serviceState=Service Status processReset.text.result=Reset mirror not saved.Reset failed! processReset.text.confirm=Confirm reset?This oparetion is dangerous and irreversible. reset.success=Reset success -reset.failed=Reset failed \ No newline at end of file +reset.failed=Reset failed + +LoginController.text.pwdErr=Password Error +LoginController.text.userValidateErr=User identity information invalid, please login again +resetPwd.text.inputPwd=Current Password +resetPwd.text.inputNewPwd=New password +resetPwd.text.reInputNewPwd=Repeat new password +resetPwd.text.pwdUpdateSuccess=Password is changed, please login again! +resetPwd.text.pwdIsNull=Password cannot be empty +resetPwd.text.pwdErr=Password error, please retype +resetPwd.text.pwdFormat= Please enter 8-16 bit uppercase, lowercase, and number combinations +resetPwd.text.notSame= Inconsistency between inputs, please retype \ No newline at end of file diff --git a/gloam/WebRoot/i18n/globalMessages_zh_CN.properties b/gloam/WebRoot/i18n/globalMessages_zh_CN.properties index 5997166..40adb46 100644 --- a/gloam/WebRoot/i18n/globalMessages_zh_CN.properties +++ b/gloam/WebRoot/i18n/globalMessages_zh_CN.properties @@ -7365,8 +7365,16 @@ processReset.text.confirm=确认重置吗?此过程具有一定危险性且不 reset.success=重置成功 reset.failed=重置失败 - - +LoginController.text.pwdErr=密码错误 +LoginController.text.userValidateErr=用户身份信息失效,请重新登录 +resetPwd.text.inputPwd=请输入当前密码 +resetPwd.text.inputNewPwd=请输入新密码 +resetPwd.text.reInputNewPwd=请再次输入新密码 +resetPwd.text.pwdUpdateSuccess=密码修改成功,请重新登录! +resetPwd.text.pwdIsNull=密码不能为空 +resetPwd.text.pwdErr=密码错误,请重新输入 +resetPwd.text.pwdFormat=请输入8-16位大写字母、小写字母、数字组合 +resetPwd.text.notSame=两次输入不一致,请重新输入 diff --git a/gloam/WebRoot/img/route/ASEM-T102-FRONT.png b/gloam/WebRoot/img/route/ASEM-T102-FRONT.png index b1ab59b..ea8d518 100644 Binary files a/gloam/WebRoot/img/route/ASEM-T102-FRONT.png and b/gloam/WebRoot/img/route/ASEM-T102-FRONT.png differ diff --git a/gloam/WebRoot/main.html b/gloam/WebRoot/main.html index ca9904b..c9cae69 100644 --- a/gloam/WebRoot/main.html +++ b/gloam/WebRoot/main.html @@ -112,12 +112,23 @@ class="halflings-icon white user"> #(session.loginUser.login_name) diff --git a/gloam/conf/i18n_en_US.properties b/gloam/conf/i18n_en_US.properties index 5967944..558160a 100644 --- a/gloam/conf/i18n_en_US.properties +++ b/gloam/conf/i18n_en_US.properties @@ -119,3 +119,5 @@ goback = back processReset = Reset Process 500 = 500 Internal Server Error 404 = 404 Not found + +reset.password = Reset Password \ No newline at end of file diff --git a/gloam/conf/i18n_zh_CN.properties b/gloam/conf/i18n_zh_CN.properties index fcd9d9e..c2ffe5b 100644 --- a/gloam/conf/i18n_zh_CN.properties +++ b/gloam/conf/i18n_zh_CN.properties @@ -114,4 +114,6 @@ processReset = \u91cd\u7f6e\u8fdb\u7a0b goback = \u8FD4\u56DE 500 = 500 \u5185\u90E8\u670D\u52A1\u9519\u8BEF -404 = 404 \u672A\u627E\u5230\u9875\u9762 \ No newline at end of file +404 = 404 \u672A\u627E\u5230\u9875\u9762 + +reset.password = \u8BBE\u7F6E\u5BC6\u7801 \ No newline at end of file diff --git a/gloam/src/com/nis/gloam/controller/LoginController.java b/gloam/src/com/nis/gloam/controller/LoginController.java index 0c43222..58b7a0d 100644 --- a/gloam/src/com/nis/gloam/controller/LoginController.java +++ b/gloam/src/com/nis/gloam/controller/LoginController.java @@ -1,18 +1,29 @@ package com.nis.gloam.controller; +import java.io.UnsupportedEncodingException; +import java.security.NoSuchAlgorithmException; +import java.util.List; + import javax.servlet.http.HttpSession; +import org.apache.log4j.Logger; + import com.jfinal.aop.Before; import com.jfinal.aop.Clear; import com.jfinal.core.Controller; import com.jfinal.kit.PropKit; +import com.jfinal.plugin.activerecord.Db; import com.nis.gloam.entity.SysUser; import com.nis.gloam.interceptor.LoginInterceptor; +import com.nis.gloam.util.Md5; import com.nis.gloam.validator.LoginValidator; + @Clear(LoginInterceptor.class) public class LoginController extends Controller { + private Logger logger=Logger.getLogger(LoginController.class); + /** * 登录界面 */ @@ -49,4 +60,47 @@ public class LoginController extends Controller { removeSessionAttr("loginFlag"); redirect("/"); } + + public void toResetPwd(){ + render("/resetPwd.html"); + } + public void validatePwd(){ + String oldPwd = getPara("oldpwd"); + SysUser user = getSessionAttr("loginUser"); + + String msg=""; + try { + if(user!=null){ + String md5pwd=Md5.EncoderByMd5(oldPwd.trim()); + if(md5pwd!=null&&md5pwd.equals(user.get("password"))){ + msg="success"; + }else{ + msg="i18n_LoginController.text.pwdErr_n81i"; + } + }else{ + msg="faild"; + } + + } catch (Exception e) { + logger.error("MD5转换失败", e); + } + renderJson("validateMsg", msg); + } + + public void resetPwd(){ + String pwd = getPara("password"); + SysUser user=getSessionAttr("loginUser"); + try { + if(user!=null){ + String md5Pwd=Md5.EncoderByMd5(pwd); + Db.update("update sys_user set password=? where login_name=?",md5Pwd,user.get("login_name")); + setAttr("updateMsg", "success"); + }else{ + setAttr("updateMsg", "i18n_LoginController.text.userValidateErr_n81i"); + } + } catch (Exception e) { + logger.error("MD5转换失败", e); + } + render("/resetPwd.html"); + } } \ No newline at end of file