You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
c7-523/src/main/java/com/qsd/orange/exception/LoginException.java

19 lines
538 B

package com.qsd.orange.exception;
import com.qsd.orange.global.HttpResult;
import com.qsd.orange.global.R;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
@ControllerAdvice
public class LoginException {
@ExceptionHandler(UsernameNotFoundException.class)
public R usernameNotFoundException(){
return R.error(HttpResult.USERNAME_OR_PASSWORD_ERROR);
}
}