From 4ff738f377504fe8f2296df18cf7d0123641cdd9 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期四, 17 十月 2019 22:11:03 +0800
Subject: [PATCH] 优化调用微服务时的报错
---
WebService/src/main/java/com/java110/web/core/VcCreateProcessor.java | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/WebService/src/main/java/com/java110/web/core/VcCreateProcessor.java b/WebService/src/main/java/com/java110/web/core/VcCreateProcessor.java
index b066aef..046e845 100644
--- a/WebService/src/main/java/com/java110/web/core/VcCreateProcessor.java
+++ b/WebService/src/main/java/com/java110/web/core/VcCreateProcessor.java
@@ -72,7 +72,7 @@
js = dealJs(js, tag);
js = dealJsAddComponentCode(js, tag);
- js = "<script type=\"text/javascript\" "+DIV_PROPERTY_COMPONENT+"=\""+componentName+"\">//<![CDATA[ \n" + js + "//]]>\n</script>";
+ js = "<script type=\"text/javascript\" " + DIV_PROPERTY_COMPONENT + "=\"" + componentName + "\">//<![CDATA[ \n" + js + "//]]>\n</script>";
htmlModel.add(modelFactory.createText(js));
}
@@ -116,11 +116,11 @@
return js;
}
- tmpProTypes = tmpProTypes.contains("\r")? tmpProTypes.replace("\r", "") : tmpProTypes;
+ tmpProTypes = tmpProTypes.contains("\r") ? tmpProTypes.replace("\r", "") : tmpProTypes;
String[] tmpType = tmpProTypes.contains("\n")
- ? tmpProTypes.split("\n")
- : tmpProTypes.split(",");
+ ? tmpProTypes.split("\n")
+ : tmpProTypes.split(",");
StringBuffer propsJs = new StringBuffer("\nvar $props = {};\n");
for (String type : tmpType) {
if (StringUtils.isEmpty(type) || !type.contains(":")) {
@@ -140,9 +140,9 @@
throw new TemplateProcessingException("缁勪欢[" + componentName + "]鏈厤缃粍浠跺睘鎬�" + attrKey);
}
String vcType = tag.getAttributeValue(attrKey);
- if(!tag.hasAttribute(attrKey) && types[1].contains("=")) {
+ if (!tag.hasAttribute(attrKey) && types[1].contains("=")) {
vcType = dealJsPropTypesDefault(types[1]);
- }else if (types[1].contains("vc.propTypes.string")) {
+ } else if (types[1].contains("vc.propTypes.string")) {
vcType = "'" + vcType + "'";
}
propsJs.append("$props." + attrKey + "=" + vcType + ";\n");
@@ -160,16 +160,16 @@
}
- private String dealJsPropTypesDefault(String typeValue){
- int startPos = typeValue.indexOf("=") + 1;
- int endPos = typeValue.length();
- if(typeValue.contains(",")){
- endPos = typeValue.indexOf(",");
- }else if(typeValue.contains("//")){
- endPos = typeValue.indexOf("//");
- }
+ private String dealJsPropTypesDefault(String typeValue) {
+ int startPos = typeValue.indexOf("=") + 1;
+ int endPos = typeValue.length();
+ if (typeValue.contains(",")) {
+ endPos = typeValue.indexOf(",");
+ } else if (typeValue.contains("//")) {
+ endPos = typeValue.indexOf("//");
+ }
- return typeValue.substring(startPos,endPos);
+ return typeValue.substring(startPos, endPos);
}
/**
--
Gitblit v1.8.0