提交 1088a5eb 编写于 作者: X xiaoyu

账户设置增加Base64解析

上级 b42de3bd
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.jeequan.jeepay.mgr.ctrl; package com.jeequan.jeepay.mgr.ctrl;
import cn.hutool.core.codec.Base64;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.aop.MethodLog; import com.jeequan.jeepay.core.aop.MethodLog;
...@@ -118,14 +119,14 @@ public class CurrentUserController extends CommonCtrl{ ...@@ -118,14 +119,14 @@ public class CurrentUserController extends CommonCtrl{
@MethodLog(remark = "修改密码") @MethodLog(remark = "修改密码")
public ApiRes modifyPwd() throws BizException{ public ApiRes modifyPwd() throws BizException{
//更改密码, 验证当前用户信息 //更改密码,验证当前用户信息
String currentUserPwd = getValStringRequired("originalPwd"); //当前用户登录密码 String currentUserPwd = Base64.decodeStr(getValStringRequired("originalPwd")); //当前用户登录密码
//验证当前密码是否正确 //验证当前密码是否正确
if(!sysUserAuthService.validateCurrentUserPwd(currentUserPwd)){ if(!sysUserAuthService.validateCurrentUserPwd(currentUserPwd)){
throw new BizException("原密码验证失败!"); throw new BizException("原密码验证失败!");
} }
String opUserPwd = getValStringRequired("confirmPwd"); String opUserPwd = Base64.decodeStr(getValStringRequired("confirmPwd"));
// 验证原密码与新密码是否相同 // 验证原密码与新密码是否相同
if (opUserPwd.equals(currentUserPwd)) { if (opUserPwd.equals(currentUserPwd)) {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.jeequan.jeepay.mch.ctrl; package com.jeequan.jeepay.mch.ctrl;
import cn.hutool.core.codec.Base64;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jeequan.jeepay.core.aop.MethodLog; import com.jeequan.jeepay.core.aop.MethodLog;
...@@ -124,14 +125,14 @@ public class CurrentUserController extends CommonCtrl{ ...@@ -124,14 +125,14 @@ public class CurrentUserController extends CommonCtrl{
Long opSysUserId = getValLongRequired("recordId"); //操作员ID Long opSysUserId = getValLongRequired("recordId"); //操作员ID
//更改密码, 验证当前用户信息 //更改密码,验证当前用户信息
String currentUserPwd = getValStringRequired("originalPwd"); //当前用户登录密码 String currentUserPwd = Base64.decodeStr(getValStringRequired("originalPwd")); //当前用户登录密码
//验证当前密码是否正确 //验证当前密码是否正确
if(!sysUserAuthService.validateCurrentUserPwd(currentUserPwd)){ if(!sysUserAuthService.validateCurrentUserPwd(currentUserPwd)){
throw new BizException("原密码验证失败!"); throw new BizException("原密码验证失败!");
} }
String opUserPwd = getValStringRequired("confirmPwd"); String opUserPwd = Base64.decodeStr(getValStringRequired("confirmPwd"));
// 验证原密码与新密码是否相同 // 验证原密码与新密码是否相同
if (opUserPwd.equals(currentUserPwd)) { if (opUserPwd.equals(currentUserPwd)) {
......
...@@ -153,7 +153,7 @@ public class SysUserController extends CommonCtrl { ...@@ -153,7 +153,7 @@ public class SysUserController extends CommonCtrl {
Boolean resetPass = getReqParamJSON().getBoolean("resetPass"); Boolean resetPass = getReqParamJSON().getBoolean("resetPass");
if (resetPass != null && resetPass) { if (resetPass != null && resetPass) {
//判断是否重置密码 //判断是否重置密码
String updatePwd = getReqParamJSON().getBoolean("defaultPass") == false? Base64.decodeStr(getValStringRequired("confirmPwd")):CS.DEFAULT_PWD; String updatePwd = getReqParamJSON().getBoolean("defaultPass") == false ? Base64.decodeStr(getValStringRequired("confirmPwd")) : CS.DEFAULT_PWD;
sysUserAuthService.resetAuthInfo(sysUser.getSysUserId(), null, null, updatePwd, CS.SYS_TYPE.MCH); sysUserAuthService.resetAuthInfo(sysUser.getSysUserId(), null, null, updatePwd, CS.SYS_TYPE.MCH);
// 删除用户redis缓存信息 // 删除用户redis缓存信息
authService.delAuthentication(Arrays.asList(recordId)); authService.delAuthentication(Arrays.asList(recordId));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册