Commit de0103f2 authored by xiaozhe.chen's avatar xiaozhe.chen

添加初始版本客服系统代码

parent 5a78881f
...@@ -12,5 +12,6 @@ public interface Constant { ...@@ -12,5 +12,6 @@ public interface Constant {
String LOGIN_SUCCESS = "登录成功"; String LOGIN_SUCCESS = "登录成功";
String LOGOUT_SUCCESS = "登出成功"; String LOGOUT_SUCCESS = "登出成功";
String LOGIN_FAIL = "登录失败"; String LOGIN_FAIL = "登录失败";
String NAME_OR_PWD_ERROR = "用户名或密码错误";
} }
package cn.quantgroup.customer.rest;
import cn.quantgroup.customer.constant.Constant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@Slf4j
@ControllerAdvice(annotations = {RestController.class, Controller.class})
public class RestAdvice {
@ExceptionHandler({BadCredentialsException.class})
@ResponseBody
@ResponseStatus(HttpStatus.OK)
public JsonResult handleBadCredentialsException(BadCredentialsException ex) {
log.info(ex.getMessage());
return JsonResult.buildErrorStateResult(Constant.NAME_OR_PWD_ERROR, null);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment