Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-cost-system
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
dc-cost-system
Commits
34f342d4
Commit
34f342d4
authored
Jan 04, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a5201220
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
MvcInterceptorConfig.java
...om/blt/other/common/interceptor/MvcInterceptorConfig.java
+2
-2
SessionHandlerInterceptor.java
...t/other/common/interceptor/SessionHandlerInterceptor.java
+12
-12
application-prod.yml
bailuntec-cost-core/src/main/resources/application-prod.yml
+2
-2
logback-spring.xml
bailuntec-cost-core/src/main/resources/logback-spring.xml
+1
-1
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/common/interceptor/MvcInterceptorConfig.java
View file @
34f342d4
...
...
@@ -23,8 +23,8 @@ public class MvcInterceptorConfig extends WebMvcConfigurationSupport {
protected
void
addInterceptors
(
InterceptorRegistry
registry
)
{
//
registry.addInterceptor(sessionHandlerInterceptor)
//
.excludePathPatterns();
registry
.
addInterceptor
(
sessionHandlerInterceptor
)
.
excludePathPatterns
();
super
.
addInterceptors
(
registry
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/common/interceptor/SessionHandlerInterceptor.java
View file @
34f342d4
package
com
.
blt
.
other
.
common
.
interceptor
;
import
com.bailuntec.common.SpringContextUtil
;
import
com.blt.other.common.annotation.LoginIgnore
;
import
com.blt.other.common.base.SysUser
;
import
com.blt.other.common.exception.BizRuntimeException
;
...
...
@@ -30,7 +29,7 @@ public class SessionHandlerInterceptor implements HandlerInterceptor {
if
(
method
.
isAnnotationPresent
(
LoginIgnore
.
class
))
{
return
true
;
}
try
{
String
token
=
Lists
.
newArrayList
(
request
.
getHeader
(
"Cookie"
).
split
(
";"
))
.
stream
()
...
...
@@ -43,18 +42,19 @@ public class SessionHandlerInterceptor implements HandlerInterceptor {
SessionUtils
.
putSysUser
(
sysUser
);
}
catch
(
Exception
ex
)
{
String
activeProfile
=
SpringContextUtil
.
getString
(
"spring.profiles.active"
);
if
(!
activeProfile
.
equals
(
"prod"
))
{
SysUser
sysUser
=
new
SysUser
();
sysUser
.
setOaUserId
(
0
);
sysUser
.
setUserName
(
"系统日志"
);
SessionUtils
.
putSysUser
(
sysUser
);
return
true
;
}
throw
new
BizRuntimeException
(
"400"
,
"请先登陆"
);
// String activeProfile = SpringContextUtil.getString("spring.profiles.active");
// if (!activeProfile.equals("prod")) {
// SysUser sysUser = new SysUser();
// sysUser.setOaUserId(0);
// sysUser.setUserName("系统日志");
// SessionUtils.putSysUser(sysUser);
// return true;
// }
// throw new BizRuntimeException("400", "请先登陆");
return
true
;
}
return
true
;
}
@Override
...
...
bailuntec-cost-core/src/main/resources/application-prod.yml
View file @
34f342d4
...
...
@@ -2,8 +2,8 @@ spring:
# 数据源配置
datasource
:
driver-class-name
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://10.0.8.2:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true
# url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true username: root
#
url: jdbc:mysql://10.0.8.2:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true
url
:
jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true
username
:
root
password
:
"
#7kfnymAM$Y9-Ntf"
hikari
:
...
...
bailuntec-cost-core/src/main/resources/logback-spring.xml
View file @
34f342d4
...
...
@@ -116,7 +116,7 @@
<!-- 正式环境日志级别为INFO -->
<springProfile
name=
"prod"
>
<logger
name=
"com.blt.other"
level=
"DEBUG"
/>
<logger
name=
"org.springframework"
level=
"
DEBUG
"
/>
<logger
name=
"org.springframework"
level=
"
INFO
"
/>
<!--日志打印的包的范围,及分类日志文件存储 -->
<logger
name=
"com.blt.other"
additivity=
"false"
>
...
...
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