Index: ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.js =================================================================== diff -u -r38086 -r40883 --- ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.js (.../modifyPWDByExt.js) (revision 38086) +++ ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.js (.../modifyPWDByExt.js) (revision 40883) @@ -1,8 +1,35 @@ var formObj; -//保存 -function save() { +//ZSYY-438:短信验证码 +function sendCodeByModify() { + // Encrypt with the public key... + sendAuthenticationCodeSms(encryptedUserName, function (res) { + if (res.success) { + setCodeTimeoutByModify(); + } + }) +} +var time2 = 60; +//倒计时 +function setCodeTimeoutByModify() { + var button = Ext4.ComponentQuery.query('button#senCode')[0]; + var t = setTimeout(function () { + if (time2 > 0) { + time2--; + button.setText(time2 + ' s'); + button.setDisabled(true); + setCodeTimeoutByModify(); + } else { + clearTimeout(t); + time2 = 60; + button.setText('发送验证码'); + button.setDisabled(false); + } + }, 1000); +} + +function saveByVerification(){ if (!formObj.form.isValid()) { showResult('请正确填写表单各值。'); return false; @@ -16,7 +43,23 @@ showResult('新密码与确认新密码不一致,请重新填写!'); return false; } + if (sstsConfig.needBeStrongPwdWhenModifyPwd && sstsConfig.enableTwoFactorAuthentication) { + var verificationCode = Ext4.getCmp('verificationCode').getValue(); + var encryptedUserCode = encrypt.encrypt(verificationCode); + validateAuthenticationCode(encryptedUserName, encryptedUserCode, function (res) { + if (res.success) { + save(); + } else { + showResult(res.message); + } + }) + } else { + save(); + } +} +//保存 +function save() { formObj.form.submit({ url: WWWROOT + '/personalSetting/modifyPWDByExt/save.do', method: 'POST', @@ -45,6 +88,10 @@ //ZSRY-72:增加密码设置要求提示语 var msg = getModifyPwdMsg(); + var hideSenCode = true; + if(msg !== '' && sstsConfig.enableTwoFactorAuthentication){ + hideSenCode = false; + } formObj = new Ext4.form.Panel({ frame: true, @@ -89,6 +136,37 @@ blankText: '请输入确认新密码!', msgTarget: 'side' }, { + hidden: hideSenCode, + layout: 'column', + border:0, + items: [{ + layout: 'form', + columnWidth: .75, + border:0, + items: [{ + xtype: 'textfield', + fieldLabel: '验证码', + name: 'verificationCode', + id: 'verificationCode', + anchor: '95%', + msgTarget: 'side', + allowBlank: true + }] + }, { + layout: 'form', + columnWidth: .25, + border:0, + items: [{ + id: 'senCode', + xtype: 'button', + text: '发送验证码', + disabled: false, + handler: function () { + sendCodeByModify(); + } + }] + }] + }, { id: 'showPwdMessage', xtype: 'displayfield', hidden: msg == '' ? true : false, @@ -100,7 +178,7 @@ buttons: [{ id: 'saveBtn', text: '确认', - handler: save + handler: saveByVerification }, { text: '取消', handler: gohistory Index: ssts-web/src/main/webapp/personalSetting/showModifyPWDWindowByExt.js =================================================================== diff -u -r40882 -r40883 --- ssts-web/src/main/webapp/personalSetting/showModifyPWDWindowByExt.js (.../showModifyPWDWindowByExt.js) (revision 40882) +++ ssts-web/src/main/webapp/personalSetting/showModifyPWDWindowByExt.js (.../showModifyPWDWindowByExt.js) (revision 40883) @@ -139,22 +139,6 @@ }); return false; } - if (sstsConfig.needBeStrongPwdWhenModifyPwd && sstsConfig.enableTwoFactorAuthentication) { - var verificationCode = Ext.getCmp('verificationCode').getValue(); - var encryptedUserCode = encrypt.encrypt(verificationCode); - validateAuthenticationCode(encryptedUserName, encryptedUserCode, function (res) { - if (res.success) { - save(); - } else { - showResult(res.message); - } - }) - } else { - save(); - } - } - - function save() { //暂时屏蔽验证复杂密码 var checkPasswordResult = testPasswordReg(Ext.getCmp('newPassword').getValue(), userNameID) if (!checkPasswordResult.success) { @@ -176,6 +160,22 @@ }); return false; } + if (sstsConfig.needBeStrongPwdWhenModifyPwd && sstsConfig.enableTwoFactorAuthentication) { + var verificationCode = Ext.getCmp('verificationCode').getValue(); + var encryptedUserCode = encrypt.encrypt(verificationCode); + validateAuthenticationCode(encryptedUserName, encryptedUserCode, function (res) { + if (res.success) { + save(); + } else { + showResult(res.message); + } + }) + } else { + save(); + } + } + + function save() { formObj.form.submit({ url: WWWROOT + '/personalSetting/modifyPWDByExt/save.do', method: 'POST', Index: ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.jsp =================================================================== diff -u -r38086 -r40883 --- ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.jsp (.../modifyPWDByExt.jsp) (revision 38086) +++ ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.jsp (.../modifyPWDByExt.jsp) (revision 40883) @@ -1,19 +1,39 @@ <%@ page contentType="text/html; charset=UTF-8"%> <%@ include file="/common/taglibs.jsp"%> +<%@page import="com.forgon.tools.crypto.rsa.RSAEncrypt"%> +<%@page import="org.apache.commons.lang.StringUtils"%> +<%@ page import="com.forgon.tools.SpringBeanManger,com.forgon.directory.vo.LoginUserData,com.forgon.portal.action.PortalPageAction"%>
<%@ include file="/common/includeExtJsAndCss.jsp"%> <%@ include file="/common/includeExtJs4_2.jsp"%> +<% + //登录密码的rsa公钥 + String logonRSAPublicKey = (String)application.getAttribute("logonRSAPublicKey"); + if(StringUtils.isBlank(logonRSAPublicKey)){ + logonRSAPublicKey = RSAEncrypt.ENCRYPTPUBLICKEY; + } +%> + +