Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
a5e6ef4d
Commit
a5e6ef4d
authored
Aug 23, 2017
by
stylefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
把ErrorTip类移到core
parent
7ac9c3c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
12 deletions
+4
-12
guns-admin/src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java
+3
-3
guns-core/src/main/java/com/stylefeng/guns/core/base/tips/ErrorTip.java
+1
-9
No files found.
guns-admin/src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java
View file @
a5e6ef4d
package
com
.
stylefeng
.
guns
.
core
.
aop
;
package
com
.
stylefeng
.
guns
.
core
.
aop
;
import
com.stylefeng.guns.common.constant.tips.ErrorTip
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.common.exception.InvalidKaptchaException
;
import
com.stylefeng.guns.common.exception.InvalidKaptchaException
;
import
com.stylefeng.guns.core.base.tips.ErrorTip
;
import
com.stylefeng.guns.core.log.LogManager
;
import
com.stylefeng.guns.core.log.LogManager
;
import
com.stylefeng.guns.core.log.factory.LogTaskFactory
;
import
com.stylefeng.guns.core.log.factory.LogTaskFactory
;
import
com.stylefeng.guns.core.shiro.ShiroKit
;
import
com.stylefeng.guns.core.shiro.ShiroKit
;
...
@@ -119,7 +119,7 @@ public class GlobalExceptionHandler {
...
@@ -119,7 +119,7 @@ public class GlobalExceptionHandler {
public
ErrorTip
credentials
(
UndeclaredThrowableException
e
)
{
public
ErrorTip
credentials
(
UndeclaredThrowableException
e
)
{
getRequest
().
setAttribute
(
"tip"
,
"权限异常"
);
getRequest
().
setAttribute
(
"tip"
,
"权限异常"
);
log
.
error
(
"权限异常!"
,
e
);
log
.
error
(
"权限异常!"
,
e
);
return
new
ErrorTip
(
BizExceptionEnum
.
NO_PERMITION
);
return
new
ErrorTip
(
BizExceptionEnum
.
NO_PERMITION
.
getCode
(),
BizExceptionEnum
.
NO_PERMITION
.
getMessage
()
);
}
}
/**
/**
...
@@ -134,7 +134,7 @@ public class GlobalExceptionHandler {
...
@@ -134,7 +134,7 @@ public class GlobalExceptionHandler {
LogManager
.
me
().
executeLog
(
LogTaskFactory
.
exceptionLog
(
ShiroKit
.
getUser
().
getId
(),
e
));
LogManager
.
me
().
executeLog
(
LogTaskFactory
.
exceptionLog
(
ShiroKit
.
getUser
().
getId
(),
e
));
getRequest
().
setAttribute
(
"tip"
,
"服务器未知运行时异常"
);
getRequest
().
setAttribute
(
"tip"
,
"服务器未知运行时异常"
);
log
.
error
(
"运行时异常:"
,
e
);
log
.
error
(
"运行时异常:"
,
e
);
return
new
ErrorTip
(
BizExceptionEnum
.
SERVER_ERROR
);
return
new
ErrorTip
(
BizExceptionEnum
.
SERVER_ERROR
.
getCode
(),
BizExceptionEnum
.
SERVER_ERROR
.
getMessage
()
);
}
}
/**
/**
...
...
guns-
admin/src/main/java/com/stylefeng/guns/common/constant
/tips/ErrorTip.java
→
guns-
core/src/main/java/com/stylefeng/guns/core/base
/tips/ErrorTip.java
View file @
a5e6ef4d
package
com
.
stylefeng
.
guns
.
common
.
constant
.
tips
;
package
com
.
stylefeng
.
guns
.
core
.
base
.
tips
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.core.base.tips.Tip
;
/**
/**
* 返回给前台的错误提示
* 返回给前台的错误提示
...
@@ -16,9 +13,4 @@ public class ErrorTip extends Tip {
...
@@ -16,9 +13,4 @@ public class ErrorTip extends Tip {
this
.
code
=
code
;
this
.
code
=
code
;
this
.
message
=
message
;
this
.
message
=
message
;
}
}
public
ErrorTip
(
BizExceptionEnum
bizExceptionEnum
)
{
this
.
code
=
bizExceptionEnum
.
getCode
();
this
.
message
=
bizExceptionEnum
.
getMessage
();
}
}
}
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