Compare commits

...

4 Commits

Author SHA1 Message Date
阿斌
982d5e4972
Pre Merge pull request !41 from 阿斌/N/A 2026-06-25 14:15:57 +00:00
panlinlin
41fd16e5d3 增加对文件上传大小超限的异常处理 2026-06-25 22:15:40 +08:00
panlinlin
2877bde26a 增加对文件上传大小超限的异常处理 2026-06-25 22:13:53 +08:00
阿斌
34d1dbb399
修复两次密码不一致时,任然可以修改密码,且成功提交,密码用*代替
还有以下一处需要修改web\src\layout\components\dialog\changePassword.vue

Signed-off-by: 阿斌 <38912748@qq.com>
2025-08-23 15:03:02 +00:00
2 changed files with 23 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MaxUploadSizeExceededException;
import org.springframework.web.servlet.resource.NoResourceFoundException;
/**
@ -32,13 +33,24 @@ public class GlobalExceptionHandler {
return WVPResult.fail(ErrorCode.ERROR500.getCode(), e.getMessage());
}
/**
* 默认异常处理
* @param e 异常
* @return 统一返回结果
*/
@ExceptionHandler(MaxUploadSizeExceededException.class)
@ResponseStatus(HttpStatus.FORBIDDEN)
public WVPResult<String> exceptionHandler(MaxUploadSizeExceededException e) {
return WVPResult.fail(ErrorCode.ERROR403.getCode(), "文件过大");
}
/**
* 默认异常处理
* @param e 异常
* @return 统一返回结果
*/
@ExceptionHandler(NoResourceFoundException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ResponseStatus(HttpStatus.NOT_FOUND)
public WVPResult<String> exceptionHandler(NoResourceFoundException e) {
return WVPResult.fail(ErrorCode.ERROR404);
}

View File

@ -13,10 +13,10 @@
<div id="shared" style="margin-right: 20px;">
<el-form ref="passwordForm" :rules="rules" status-icon label-width="80px">
<el-form-item label="新密码" prop="newPassword">
<el-input v-model="newPassword" autocomplete="off" />
<el-input v-model="newPassword" autocomplete="off" type="password" />
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword">
<el-input v-model="confirmPassword" autocomplete="off" />
<el-input v-model="confirmPassword" autocomplete="off" type="password" />
</el-form-item>
<el-form-item>
@ -88,6 +88,14 @@ export default {
}
},
onSubmit: function() {
if (this.newPassword !== this.confirmPassword) {
this.$message({
showClose: true,
message: '两次输入密码不一致!',
type: 'error'
})
return
}
this.$store.dispatch('user/changePasswordForAdmin', {
password: this.newPassword,
userId: this.form.id