File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/main/java/io/github/talelin/latticy/controller/cms Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
package io .github .talelin .latticy .controller .cms ;
2
2
3
- import io .github .talelin .autoconfigure .exception .ForbiddenException ;
4
3
import io .github .talelin .autoconfigure .exception .NotFoundException ;
5
4
import io .github .talelin .autoconfigure .exception .ParameterException ;
6
5
import io .github .talelin .core .annotation .AdminRequired ;
@@ -78,14 +77,14 @@ public CreatedVO register(@RequestBody @Validated RegisterDTO validator) {
78
77
* 用户登陆
79
78
*/
80
79
@ PostMapping ("/login" )
81
- public Tokens login (@ RequestBody @ Validated LoginDTO validator , @ RequestHeader ("Tag" ) String tag ) {
82
- // TODO: 使用spring validation验证。暂时还没想到怎么根据配置文件分组
80
+ public Tokens login (@ RequestBody @ Validated LoginDTO validator , @ RequestHeader (value = "Tag" , required = false ) String tag ) {
83
81
if (captchaConfig .getEnabled ()) {
82
+ // TODO: 使用spring validation验证。暂时还没想到怎么根据配置文件分组
84
83
if (!StringUtils .hasText (validator .getCaptcha ()) || !StringUtils .hasText (tag )) {
85
84
throw new ParameterException ("验证码不可为空" );
86
85
}
87
86
if (!userService .verifyCaptcha (validator .getCaptcha (), tag )) {
88
- throw new ForbiddenException (10260 );
87
+ throw new ParameterException (10260 );
89
88
}
90
89
}
91
90
UserDO user = userService .getUserByUsername (validator .getUsername ());
You can’t perform that action at this time.
0 commit comments