From 0293e06edd011d6921ec2cc08392042f5765dfb8 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 18 九月 2025 13:35:54 +0800
Subject: [PATCH] 日志修改
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
index cfd903c..468612a 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
@@ -2,6 +2,7 @@
import java.io.IOException;
+import com.ruoyi.common.core.domain.entity.UpdateUserPWD;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -61,7 +62,7 @@
* 淇敼鐢ㄦ埛
*/
@Log(title = "涓汉淇℃伅", businessType = BusinessType.UPDATE)
- @PutMapping
+ @PostMapping("/updateProfile")
public AjaxResult updateProfile(@RequestBody SysUser user)
{
if (StringUtils.isNotEmpty(user.getPhonenumber())
@@ -95,27 +96,27 @@
* 閲嶇疆瀵嗙爜
*/
@Log(title = "涓汉淇℃伅", businessType = BusinessType.UPDATE)
- @PutMapping("/updatePwd")
- public AjaxResult updatePwd(String oldPassword, String newPassword)
+ @PostMapping("/updatePwd")
+ public AjaxResult updatePwd(@RequestBody UpdateUserPWD updateUserPWD)
{
LoginUser loginUser = getLoginUser();
String userName = loginUser.getUsername();
String password = loginUser.getPassword();
- if (!SecurityUtils.matchesPassword(oldPassword, password))
+ if (!SecurityUtils.matchesPassword(updateUserPWD.getOldPassword(), password))
{
return AjaxResult.error("淇敼瀵嗙爜澶辫触锛屾棫瀵嗙爜閿欒");
}
- if (SecurityUtils.matchesPassword(newPassword, password))
+ if (SecurityUtils.matchesPassword(updateUserPWD.getNewPassword(), password))
{
return AjaxResult.error("鏂板瘑鐮佷笉鑳戒笌鏃у瘑鐮佺浉鍚�");
}
- if(!checkPasswordRule(newPassword)){
+ if(!checkPasswordRule(updateUserPWD.getNewPassword())){
return AjaxResult.error("瀵嗙爜鏍煎紡: 澶у皬鍐欏瓧姣嶃�佹暟瀛椼�佺壒娈婂瓧绗︿腑鐨勮嚦灏戜笁绉嶏紙闀垮害澶т簬绛変簬8浣嶏級");
}
- if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0 && checkPasswordRule(newPassword))
+ if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(updateUserPWD.getNewPassword())) > 0 && checkPasswordRule(updateUserPWD.getNewPassword()))
{
// 鏇存柊缂撳瓨鐢ㄦ埛瀵嗙爜
- loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
+ loginUser.getUser().setPassword(SecurityUtils.encryptPassword(updateUserPWD.getNewPassword()));
tokenService.setLoginUser(loginUser);
return AjaxResult.success();
}
--
Gitblit v1.9.3