|
|
@@ -39,6 +39,7 @@ import com.ruoyi.system.utils.Auth;
|
|
|
import com.ruoyi.system.utils.AuthContext;
|
|
|
import com.ruoyi.system.utils.JwtUtil;
|
|
|
import com.ruoyi.system.utils.MobileSMS;
|
|
|
+import com.ruoyi.app.user.dto.InfoUserResetPwdDto;
|
|
|
import com.ruoyi.app.user.dto.OAuthBindDto;
|
|
|
import com.ruoyi.app.user.dto.OAuthDeviceConfirmDto;
|
|
|
import com.ruoyi.app.user.dto.OAuthLoginDto;
|
|
|
@@ -1658,6 +1659,32 @@ public class InfoUserController extends BaseController {
|
|
|
return toAjax(infoUserService.updateInfoUser(infoUser));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 重置用户登录密码(独立于通用编辑,密文入库,与 App 端 RSA 公钥体系一致)
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('infouser:user:resetPwd')")
|
|
|
+ @Log(title = "用户信息", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/resetPwd")
|
|
|
+ public AjaxResult resetPwd(@RequestBody InfoUserResetPwdDto resetPwdDto) {
|
|
|
+ if (resetPwdDto.getUserId() == null) {
|
|
|
+ return error(MessageUtils.message("no.user.not.exist"));
|
|
|
+ }
|
|
|
+ if (resetPwdDto.getPassword() == null || resetPwdDto.getPassword().isEmpty()) {
|
|
|
+ return error(MessageUtils.message("no.user.password.not.null"));
|
|
|
+ }
|
|
|
+ InfoUser user = infoUserService.selectInfoUserByUserId(resetPwdDto.getUserId());
|
|
|
+ if (user == null) {
|
|
|
+ return error(MessageUtils.message("no.user.not.exist"));
|
|
|
+ }
|
|
|
+ if (MerchantAccountConstants.SUBACCOUNT_USER_TYPE.equals(user.getUserType())) {
|
|
|
+ return error(MessageUtils.message("merchant.subaccount.platform.managed"));
|
|
|
+ }
|
|
|
+ boolean updated = infoUserService.update(new LambdaUpdateWrapper<InfoUser>()
|
|
|
+ .eq(InfoUser::getUserId, user.getUserId())
|
|
|
+ .set(InfoUser::getPassword, resetPwdDto.getPassword()));
|
|
|
+ return updated ? success() : error(MessageUtils.message("no.system.error"));
|
|
|
+ }
|
|
|
+
|
|
|
private boolean normalizeAuditRejectReason(InfoUser infoUser) {
|
|
|
if (!"2".equals(infoUser.getAuditStatus())) {
|
|
|
infoUser.setAuditRejectReason(null);
|