mirror of
https://gitee.com/wangkang/udf.git
synced 2026-11-05 11:05:30 +00:00
更新
This commit is contained in:
@@ -54,6 +54,8 @@ public class RmsAuthHandlerInterceptor implements HandlerInterceptor {
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, //NOSONAR
|
||||
Object handler) {
|
||||
//获得当前环境
|
||||
String profilesActive = env.getProperty("spring.profiles.active");
|
||||
//获取认证信息(应用名称)
|
||||
String rmsApplicationName = request.getHeader(Constant.HEADER_RMS_APPLICATION_NAME_CODE);
|
||||
if (StringUtils.isBlank(rmsApplicationName)) {
|
||||
@@ -74,10 +76,9 @@ public class RmsAuthHandlerInterceptor implements HandlerInterceptor {
|
||||
//获取请求方法
|
||||
String method = request.getMethod();
|
||||
//日志
|
||||
LOGGER.info("rmsApplicationName:{},rmsSign:{},rmsServiceCode:{},url:{},method:{}", rmsApplicationName, rmsSign,
|
||||
rmsServiceCode, url, method);
|
||||
LOGGER.info("profiles.active:{},rmsApplicationName:{},rmsSign:{},rmsServiceCode:{},url:{},method:{}", profilesActive, rmsApplicationName, rmsSign, rmsServiceCode, url, method);
|
||||
//判断环境(开发环境无需校验)
|
||||
if (!DEV_PROFILES.equals(env.getProperty("spring.profiles.active"))) {
|
||||
if (!DEV_PROFILES.equals(profilesActive)) {
|
||||
//判断是否缺少认证信息
|
||||
if (StringUtils.isBlank(rmsApplicationName) || StringUtils.isBlank(rmsSign)) {
|
||||
throw new AuthException("missing required authentication parameters (rmsApplicationName , rmsSign)");
|
||||
|
||||
@@ -6,18 +6,16 @@
|
||||
*/
|
||||
package org.itkk.udf.rms.web;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.itkk.udf.core.RestResponse;
|
||||
import org.itkk.udf.rms.RmsConfig;
|
||||
import org.itkk.udf.rms.RmsProperties;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import org.itkk.udf.core.RestResponse;
|
||||
import org.itkk.udf.rms.RmsConfig;
|
||||
import org.itkk.udf.rms.RmsProperties;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* 描述 : RmsController
|
||||
*
|
||||
@@ -25,7 +23,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
*/
|
||||
@Api(value = "rest服务", consumes = "application/json", produces = "application/json", protocols = "http")
|
||||
@RestController
|
||||
@RequestMapping("rms")
|
||||
@RequestMapping("service/rms")
|
||||
public class RmsController {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user