Quellcode durchsuchen

密码最后修改时间功能

wukai vor 2 Jahren
Ursprung
Commit
f7f7b4a7dc

+ 13 - 0
doc-admin/src/main/java/com/doc/web/controller/system/SysProfileController.java

@@ -6,6 +6,7 @@ import com.doc.common.config.RuoYiConfig;
 import com.doc.common.core.controller.BaseController;
 import com.doc.common.core.domain.AjaxResult;
 import com.doc.common.core.domain.entity.SysUser;
+import com.doc.common.core.domain.entity.SysUserExpand;
 import com.doc.common.core.domain.model.LoginUser;
 import com.doc.common.enums.BusinessType;
 import com.doc.common.utils.SecurityUtils;
@@ -13,11 +14,13 @@ import com.doc.common.utils.StringUtils;
 import com.doc.common.utils.file.FileUploadUtils;
 import com.doc.common.utils.file.MimeTypeUtils;
 import com.doc.framework.web.service.TokenService;
+import com.doc.system.service.ISysUserExpandService;
 import com.doc.system.service.ISysUserService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import java.util.Date;
 
 /**
  * 个人信息 业务处理
@@ -36,6 +39,9 @@ public class SysProfileController extends BaseController {
     @Resource
     private IDocSpaceService docSpaceService;
 
+    @Resource
+    private ISysUserExpandService expandService;
+
     /**
      * 个人信息
      */
@@ -101,6 +107,13 @@ public class SysProfileController extends BaseController {
             // 更新缓存用户密码
             loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
             tokenService.setLoginUser(loginUser);
+
+            // 更新扩展表中密码修改时间
+            SysUserExpand expand = new SysUserExpand();
+            expand.setUserId(loginUser.getUserId());
+            expand.setLastUpdateTime(new Date());
+            expandService.updateSysUserExpand(expand);
+
             return success();
         }
         return error("修改密码异常,请联系管理员");