Commit 34f342d4 by huluobin

update

parent a5201220
...@@ -23,8 +23,8 @@ public class MvcInterceptorConfig extends WebMvcConfigurationSupport { ...@@ -23,8 +23,8 @@ public class MvcInterceptorConfig extends WebMvcConfigurationSupport {
protected void addInterceptors(InterceptorRegistry registry) { protected void addInterceptors(InterceptorRegistry registry) {
// registry.addInterceptor(sessionHandlerInterceptor) registry.addInterceptor(sessionHandlerInterceptor)
// .excludePathPatterns(); .excludePathPatterns();
super.addInterceptors(registry); super.addInterceptors(registry);
......
package com.blt.other.common.interceptor; package com.blt.other.common.interceptor;
import com.bailuntec.common.SpringContextUtil;
import com.blt.other.common.annotation.LoginIgnore; import com.blt.other.common.annotation.LoginIgnore;
import com.blt.other.common.base.SysUser; import com.blt.other.common.base.SysUser;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
...@@ -30,7 +29,7 @@ public class SessionHandlerInterceptor implements HandlerInterceptor { ...@@ -30,7 +29,7 @@ public class SessionHandlerInterceptor implements HandlerInterceptor {
if (method.isAnnotationPresent(LoginIgnore.class)) { if (method.isAnnotationPresent(LoginIgnore.class)) {
return true; return true;
} }
try { try {
String token = Lists.newArrayList(request.getHeader("Cookie").split(";")) String token = Lists.newArrayList(request.getHeader("Cookie").split(";"))
.stream() .stream()
...@@ -43,18 +42,19 @@ public class SessionHandlerInterceptor implements HandlerInterceptor { ...@@ -43,18 +42,19 @@ public class SessionHandlerInterceptor implements HandlerInterceptor {
SessionUtils.putSysUser(sysUser); SessionUtils.putSysUser(sysUser);
} catch (Exception ex) { } catch (Exception ex) {
String activeProfile = SpringContextUtil.getString("spring.profiles.active"); // String activeProfile = SpringContextUtil.getString("spring.profiles.active");
if (!activeProfile.equals("prod")) { // if (!activeProfile.equals("prod")) {
SysUser sysUser = new SysUser(); // SysUser sysUser = new SysUser();
sysUser.setOaUserId(0); // sysUser.setOaUserId(0);
sysUser.setUserName("系统日志"); // sysUser.setUserName("系统日志");
SessionUtils.putSysUser(sysUser); // SessionUtils.putSysUser(sysUser);
return true; // return true;
} // }
throw new BizRuntimeException("400", "请先登陆"); // throw new BizRuntimeException("400", "请先登陆");
return true;
} }
return true;
} }
@Override @Override
......
...@@ -2,8 +2,8 @@ spring: ...@@ -2,8 +2,8 @@ spring:
# 数据源配置 # 数据源配置
datasource: datasource:
driver-class-name: com.mysql.jdbc.Driver 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://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://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true
username: root username: root
password: "#7kfnymAM$Y9-Ntf" password: "#7kfnymAM$Y9-Ntf"
hikari: hikari:
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
<!-- 正式环境日志级别为INFO --> <!-- 正式环境日志级别为INFO -->
<springProfile name="prod"> <springProfile name="prod">
<logger name="com.blt.other" level="DEBUG"/> <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"> <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