I used spring boot to implement a login interface, the problem encountered.

I implemented a login interface in spring boot and wrote a handleException method. At the breakpoint, I found that I only entered the handleException, not the login method.

is it caused by the cause? How should I solve this problem?

the following is the screenshot I provided:

clipboard.png


clipboard.png

clipboard.png

code has been updated to github

May.19,2022

clipboard.png

be careful! Otpcode = optcode


it can be understood that the occurrence of this exception is not to enter the
triggered by login, but to verify that the parameter is abnormal before entering the method
, so it enters the general exception interception

.

secondly, the abnormal information has been and clearly defined. You can see

at a glance through the abnormal information.

solution:
is probably caused by @ RequestParam. Just get rid of it. It should be that this thing implements a set of parameter verification internally. What I want to implement is the optional parameter.

  

your password is a required parameter

Menu