提交 2f9a9b39 编写于 作者: zhouweidong's avatar zhouweidong

解决动态模型导入时中文乱码问题

上级 51a756ab
...@@ -28,10 +28,7 @@ import org.springframework.util.DigestUtils; ...@@ -28,10 +28,7 @@ import org.springframework.util.DigestUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.io.File; import java.io.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -314,7 +311,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl { ...@@ -314,7 +311,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
* @param filePath * @param filePath
* @return * @return
*/ */
private JSONObject getSystem(String filePath) { private JSONObject getSystem(String filePath) throws UnsupportedEncodingException {
JSONObject system = null; JSONObject system = null;
InputStream in = null; InputStream in = null;
byte[] bytes = null; byte[] bytes = null;
...@@ -336,7 +333,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl { ...@@ -336,7 +333,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
} }
} }
if (bytes != null) { if (bytes != null) {
String strSystem = new String(bytes); String strSystem = new String(bytes,"utf8");
if (!StringUtils.isEmpty(strSystem)) { if (!StringUtils.isEmpty(strSystem)) {
system = JSONObject.parseObject(strSystem); system = JSONObject.parseObject(strSystem);
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册