修复申请原因可能为空的bug

This commit is contained in:
WilliamColton
2025-08-04 18:36:32 +08:00
parent 6fa5978613
commit 3b82a4aba0
2 changed files with 7 additions and 7 deletions
@@ -155,7 +155,7 @@ public class AuthController {
)); ));
} }
if (req.reason == null || req.reason.length() <= 20) { if (req.reason == null || req.reason.trim().length() <= 20) {
return ResponseEntity.badRequest().body(Map.of( return ResponseEntity.badRequest().body(Map.of(
"error", "Reason's length must longer than 20", "error", "Reason's length must longer than 20",
"reason_code", "INVALID_CREDENTIALS" "reason_code", "INVALID_CREDENTIALS"
+1 -1
View File
@@ -39,7 +39,7 @@ export default {
}, },
methods: { methods: {
async submit() { async submit() {
if (!this.reason || this.reason.length < 20) { if (!this.reason || this.reason.trim().length < 20) {
this.error = '请至少输入20个字' this.error = '请至少输入20个字'
return return
} }