|
@@ -56,7 +56,7 @@ public class DynamicDataSourceHandler extends HandlerInterceptorAdapter {
|
|
|
if (StringUtils.containsAny(requestURI, IGNORE_URL)) {
|
|
|
return true;
|
|
|
}
|
|
|
- resetDataSource(request);
|
|
|
+ resetDataSource(request.getRequestURI());
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -64,7 +64,7 @@ public class DynamicDataSourceHandler extends HandlerInterceptorAdapter {
|
|
|
* 多租户处理,数据源切换
|
|
|
* @param request
|
|
|
*/
|
|
|
- public void resetDataSource(HttpServletRequest request) {
|
|
|
+ public void resetDataSource(String requestUri) {
|
|
|
// 是否启用多数据源
|
|
|
boolean isDynamic = SpringHelper.getBoolean("spring.datasource.dynamic.enabled", false);
|
|
|
if (!isDynamic) {
|
|
@@ -87,7 +87,7 @@ public class DynamicDataSourceHandler extends HandlerInterceptorAdapter {
|
|
|
* 判断如果如果是DMP-ALARM 请求的路径就切换到默认的数据库
|
|
|
*/
|
|
|
for (String url : notUrlList) {
|
|
|
- if(request.getRequestURI().contains(url)) {
|
|
|
+ if(requestUri.contains(url)) {
|
|
|
newDsName =dbNameDefault;
|
|
|
break;
|
|
|
}
|