has been modified successfully, thank you for your comments, change the code role.equals(" administrator ") to Objects.equals(role, "administrator ") can be
0 Answer
has been modified successfully, thank you for your comments, change the code role.equals(" administrator ") to Objects.equals(role, "administrator ") can be
Two directions:
First whether the role parameter is passed
@Param Parameter is passed from the front end by specifying the attribute value. Parameter is passed or no parameter is passed. If role is empty, the method cannot be invoked.
Second, from the perspective of compatibility,
does not use role to call equals directly, but uses "administrator ".equas(role) to do logical processing. If role is empty or null character, do processing; if not, do service processing.
/login is called by the browser. Check whether the role parameter is passed during the request.
这家伙很懒,什么都没留下...