From bdfd2f0787b0a39fb65793a7f57c95f5de09edf4 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 30 八月 2021 12:49:19 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev
---
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java | 12 +++++++++---
ruoyi-ui/src/utils/ruoyi.js | 2 +-
ruoyi-ui/src/api/login.js | 5 +++--
ruoyi-ui/src/components/DictTag/index.vue | 6 +++---
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
index 700a88d..8af1257 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
@@ -65,8 +65,8 @@
// xss杩囨护
json = HtmlUtil.cleanHtmlTag(json).trim();
-
- final ByteArrayInputStream bis = IoUtil.toStream(json, StandardCharsets.UTF_8);
+ byte[] jsonBytes = json.getBytes(StandardCharsets.UTF_8);
+ final ByteArrayInputStream bis = IoUtil.toStream(jsonBytes);
return new ServletInputStream()
{
@Override
@@ -79,6 +79,12 @@
public boolean isReady()
{
return true;
+ }
+
+ @Override
+ public int available() throws IOException
+ {
+ return jsonBytes.length;
}
@Override
@@ -104,4 +110,4 @@
String header = super.getHeader(HttpHeaders.CONTENT_TYPE);
return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE);
}
-}
+}
\ No newline at end of file
diff --git a/ruoyi-ui/src/api/login.js b/ruoyi-ui/src/api/login.js
index 8b5b6cf..a10fbe6 100644
--- a/ruoyi-ui/src/api/login.js
+++ b/ruoyi-ui/src/api/login.js
@@ -47,6 +47,7 @@
export function getCodeImg() {
return request({
url: '/captchaImage',
- method: 'get'
+ method: 'get',
+ timeout: 20000
})
-}
+}
\ No newline at end of file
diff --git a/ruoyi-ui/src/components/DictTag/index.vue b/ruoyi-ui/src/components/DictTag/index.vue
index 4779415..542c6ed 100644
--- a/ruoyi-ui/src/components/DictTag/index.vue
+++ b/ruoyi-ui/src/components/DictTag/index.vue
@@ -31,12 +31,12 @@
type: Array,
default: null,
},
- value: [String, Array],
+ value: [Number, String, Array],
},
computed: {
values() {
- if (this.value) {
- return Array.isArray(this.value) ? this.value : [this.value];
+ if (this.value !== null && typeof this.value !== 'undefined') {
+ return Array.isArray(this.value) ? this.value : [String(this.value)];
} else {
return [];
}
diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js
index b426a31..68fb6bb 100644
--- a/ruoyi-ui/src/utils/ruoyi.js
+++ b/ruoyi-ui/src/utils/ruoyi.js
@@ -18,7 +18,7 @@
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
- time = time.replace(new RegExp(/-/gm), '/');
+ time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm),'');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
--
Gitblit v1.9.3