Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
customer-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
customer-service
Commits
de0103f2
Commit
de0103f2
authored
Nov 04, 2019
by
xiaozhe.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加初始版本客服系统代码
parent
5a78881f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
Constant.java
src/main/java/cn/quantgroup/customer/constant/Constant.java
+1
-0
RestAdvice.java
src/main/java/cn/quantgroup/customer/rest/RestAdvice.java
+22
-0
No files found.
src/main/java/cn/quantgroup/customer/constant/Constant.java
View file @
de0103f2
...
@@ -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
=
"用户名或密码错误"
;
}
}
src/main/java/cn/quantgroup/customer/rest/RestAdvice.java
0 → 100644
View file @
de0103f2
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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment