Commit 34f342d4 by huluobin

update

parent a5201220
......@@ -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);
......
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
......
......@@ -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:
......
......@@ -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">
......
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