|
|
@@ -17,7 +17,9 @@ import cn.com.taiji.core.entity.user.AccountUserRole; |
|
|
|
import cn.com.taiji.core.entity.user.Staff; |
|
|
|
import cn.com.taiji.core.entity.user.UserRole; |
|
|
|
import cn.com.taiji.core.manager.cache.RedisCacheManager; |
|
|
|
import cn.com.taiji.core.manager.cache.RedisKeyGenerator; |
|
|
|
import cn.com.taiji.core.manager.tools.DesensitizedUtil; |
|
|
|
import cn.com.taiji.core.manager.tools.encryption.SM4Util; |
|
|
|
import cn.com.taiji.core.manager.tools.minio.MinioUtil; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkAgencyRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkServicehallRepo; |
|
|
@@ -547,6 +549,23 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager |
|
|
|
return response; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void changePassword(ChangePasswordRequestDTO dto) throws ManagerException { |
|
|
|
AccountInfo accountInfo = findAccountInfoByToken(dto.getAccessToken()); |
|
|
|
if (accountInfo == null) throw new ManagerException("员工未注册"); |
|
|
|
if (!"1".equals(accountInfo.getNeedChangePasswordNow())) { |
|
|
|
throw new ManagerException("当前用户不允许通过只输入新密码的方式修改密码!请更换其他的修改密码方式!"); |
|
|
|
} |
|
|
|
if(!dto.getNewPassword().equals(dto.getAffirmNewPassword())){ |
|
|
|
throw new ManagerException("新密码和确认新密码不一致!"); |
|
|
|
} |
|
|
|
accountInfo.setLoginPass(dto.getNewPassword()); |
|
|
|
accountInfo.setNeedChangePasswordNow("0"); |
|
|
|
accountInfo.setUpdateTime(LocalDateTime.now()); |
|
|
|
deleteTokenCache(dto.getAccessToken()); |
|
|
|
accountInfoRepo.save(accountInfo); |
|
|
|
} |
|
|
|
|
|
|
|
private boolean isMatch(RbacSource rbacSource, SystemType systemType) { |
|
|
|
switch (rbacSource) { |
|
|
|
case APP: |
|
|
@@ -561,4 +580,15 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
String s = "4aeb49ace971354d6fff839b804a63b5861f04074bb561f09364860d9113c62a"; |
|
|
|
String s1 = "17610023822"; |
|
|
|
try { |
|
|
|
System.out.println(SM4Util.decrypt(s)); |
|
|
|
System.out.println(SM4Util.encrypt(s1)); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |