he2802 il y a 2 ans
Parent
commit
7c488acae7

+ 3 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/system/SysUserController.java

@@ -18,10 +18,7 @@ import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.exception.user.UserPasswordNotMatchException;
-import com.zhongzheng.common.utils.MessageUtils;
-import com.zhongzheng.common.utils.SecurityUtils;
-import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.common.utils.ToolsUtils;
+import com.zhongzheng.common.utils.*;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
 import com.zhongzheng.framework.manager.AsyncManager;
 import com.zhongzheng.framework.manager.factory.AsyncFactory;
@@ -168,6 +165,7 @@ public class SysUserController extends BaseController
             throw new CustomException("密码应由8-16位数字、大小写字母、符号组成");
         }
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+        user.setPwdTime(DateUtils.getNowTime());
         return toAjax(userService.insertUser(user));
     }
 
@@ -224,6 +222,7 @@ public class SysUserController extends BaseController
                 throw new CustomException("密码应由8-16位数字、大小写字母、符号组成");
             }
             user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
+            user.setPwdTime(DateUtils.getNowTime());
         }
         user.setUpdateBy(SecurityUtils.getUsername());
         int result = userService.updateUser(user);

+ 3 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/SysUser.java

@@ -166,6 +166,9 @@ public class SysUser implements Serializable
     /** 上一次登录时间 */
     private Date preLoginDate;
 
+    /** 密码最后修改时间 */
+    private Long pwdTime;
+
     public SysUser(Long userId)
     {
         this.userId = userId;

+ 1 - 1
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysTenantServiceImpl.java

@@ -42,7 +42,7 @@ import java.util.stream.Collectors;
  * @date 2021-08-03
  */
 @Service
-@DS("slave") //指定数据源
+//@DS("slave") //指定数据源
 public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant> implements ISysTenantService {
 
     @Autowired

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/system/SysUserMapper.xml

@@ -26,6 +26,7 @@
         <result property="code" column="code"/>
         <result property="preLoginIp" column="pre_login_ip"/>
         <result property="preLoginDate" column="pre_login_date"/>
+        <result property="pwdTime" column="pwd_time"/>
         <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/>
         <collection property="roles" column="user_id" select="findRolesList" javaType="java.util.List" />
     </resultMap>