diff --git a/ruoyi-ui/public/robots.txt b/ruoyi-ui/public/robots.txt new file mode 100644 index 0000000..c2aab7e --- /dev/null +++ b/ruoyi-ui/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 963a823..b7f16f3 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -117,7 +117,11 @@ module.exports = { } } }) - config.optimization.runtimeChunk('single') + config.optimization.runtimeChunk('single'), + { + from: path.resolve(__dirname, './public/robots.txt'),//防爬虫文件 + to:'./',//到根目录下 + } } ) } diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java index 2078240..5e92cde 100644 --- a/ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java +++ b/ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java @@ -118,7 +118,7 @@ public class HttpUtils StringBuilder result = new StringBuilder(); try { - String urlNameString = url + "?" + param; + String urlNameString = url; log.info("sendPost - {}", urlNameString); URL realUrl = new URL(urlNameString); URLConnection conn = realUrl.openConnection(); diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java b/ruoyi/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java index 9e050e9..5aa15df 100644 --- a/ruoyi/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java +++ b/ruoyi/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java @@ -40,7 +40,7 @@ public class IpUtils { ip = request.getRemoteAddr(); } - + ip = EscapeUtil.clean(ip);//清除Xss特殊字符 return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; } diff --git a/ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java b/ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java index 047cd2d..29a840d 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java +++ b/ruoyi/src/main/java/com/ruoyi/project/tool/gen/util/GenUtils.java @@ -58,11 +58,11 @@ public class GenUtils { column.setHtmlType(GenConstants.HTML_INPUT); - // 如果是浮点型 + // 如果是浮点型 统一用BigDecimal String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { - column.setJavaType(GenConstants.TYPE_DOUBLE); + column.setJavaType(GenConstants.TYPE_BIGDECIMAL); } // 如果是整形 else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10)