mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-08-19 09:40:58 +00:00
修复申请原因可能为空的bug
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user