Merge branch 'master' of https://gitee.com/y_project/RuoYi-Cloud
This commit is contained in:
commit
7277f03f2a
6
pom.xml
6
pom.xml
|
|
@ -142,6 +142,12 @@
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.apache.velocity</groupId>
|
||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
<version>${velocity.version}</version>
|
<version>${velocity.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>commons-collections</groupId>
|
||||||
|
<artifactId>commons-collections</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON 解析器和生成器 -->
|
<!-- JSON 解析器和生成器 -->
|
||||||
|
|
|
||||||
|
|
@ -797,7 +797,17 @@ public class Convert
|
||||||
}
|
}
|
||||||
else if (obj instanceof byte[] || obj instanceof Byte[])
|
else if (obj instanceof byte[] || obj instanceof Byte[])
|
||||||
{
|
{
|
||||||
return str((Byte[]) obj, charset);
|
if (obj instanceof byte[]){
|
||||||
|
return str((byte[]) obj, charset);
|
||||||
|
} else {
|
||||||
|
Byte[] bytes = (Byte[])obj;
|
||||||
|
int length = bytes.length;
|
||||||
|
byte[] dest = new byte[length];
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
dest[i] = bytes[i];
|
||||||
|
}
|
||||||
|
return str (dest,charset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (obj instanceof ByteBuffer)
|
else if (obj instanceof ByteBuffer)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,10 @@ package com.ruoyi.common.core.web.controller;
|
||||||
import java.beans.PropertyEditorSupport;
|
import java.beans.PropertyEditorSupport;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ruoyi.common.core.constant.HttpStatus;
|
import com.ruoyi.common.core.constant.HttpStatus;
|
||||||
|
|
@ -27,7 +25,7 @@ import com.ruoyi.common.core.web.page.TableSupport;
|
||||||
*/
|
*/
|
||||||
public class BaseController
|
public class BaseController
|
||||||
{
|
{
|
||||||
protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
|
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.common.security.feign;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.core.constant.CacheConstants;
|
import com.ruoyi.common.core.constant.CacheConstants;
|
||||||
import com.ruoyi.common.core.utils.ServletUtils;
|
import com.ruoyi.common.core.utils.ServletUtils;
|
||||||
|
|
@ -40,6 +41,9 @@ public class FeignRequestInterceptor implements RequestInterceptor
|
||||||
{
|
{
|
||||||
requestTemplate.header(CacheConstants.AUTHORIZATION_HEADER, authentication);
|
requestTemplate.header(CacheConstants.AUTHORIZATION_HEADER, authentication);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 配置客户端IP
|
||||||
|
requestTemplate.header("X-Forwarded-For", IpUtils.getIpAddr(ServletUtils.getRequest()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue