| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 881bde6 commit fedcfa9
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,14 +43,12 @@ public static String parse(final String name, final JSONObject request) { | |||
| 43 | 43 | if (set != null) { | |
| 44 | 44 | ||
| 45 | 45 | Object value; | |
| 46 | - String pairKey; | ||
| 47 | 46 | for (String key : set) { | |
| 48 | 47 | value = request.get(key); | |
| 49 | 48 | if (value == null) { | |
| 50 | 49 | continue; | |
| 51 | 50 | } | |
| 52 | 51 | ||
| 53 | - pairKey = new String(key instanceof String ? "\"" + key + "\"" : key); | ||
| 54 | 52 | if (value instanceof JSONObject) {//APIJSON Array转为常规JSONArray | |
| 55 | 53 | if (isArrayKey(key)) {//APIJSON Array转为常规JSONArray | |
| 56 | 54 | response += NEWLINE + NEWLINE + "//" + key + "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"; | |
@@ -65,22 +63,25 @@ public static String parse(final String name, final JSONObject request) { | |||
| 65 | 63 | ||
| 66 | 64 | String prefix = key.substring(0, key.length() - 2); | |
| 67 | 65 | response += NEWLINE + NEWLINE | |
| 68 | - + parentKey + ".add(" + getItemKey(key) + ".toArray(" | ||
| 66 | + + parentKey + ".putAll(" + getItemKey(key) + ".toArray(" | ||
| 69 | 67 | + count + ", " + page + (prefix.isEmpty() ? "" : ", \"" + prefix + "\"") + "));"; | |
| 70 | 68 | ||
| 71 | 69 | response += NEWLINE + "//" + key + ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + NEWLINE; | |
| 72 | - } else {//常规JSONObject,往下一级提取 | ||
| 70 | + } | ||
| 71 | + else {//常规JSONObject,往下一级提取 | ||
| 73 | 72 | response += NEWLINE + NEWLINE + "//" + key + "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"; | |
| 74 | 73 | ||
| 75 | 74 | response += parse(key, (JSONObject) value); | |
| 76 | 75 | ||
| 77 | - response += NEWLINE + NEWLINE + parentKey + ".put(" + pairKey + ", " + getTableKey(key) + ");"; | ||
| 76 | + response += NEWLINE + NEWLINE + parentKey + ".put(\"" + key + "\", " + getTableKey(key) + ");"; | ||
| 78 | 77 | response += NEWLINE + "//" + key + ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + NEWLINE; | |
| 79 | 78 | } | |
| 80 | - } else {//其它Object,直接填充 | ||
| 79 | + } | ||
| 80 | + else {//其它Object,直接填充 | ||
| 81 | 81 | if (value instanceof String) { | |
| 82 | 82 | value = "\"" + value + "\""; | |
| 83 | - } else if (value instanceof JSONArray) { | ||
| 83 | + } | ||
| 84 | + else if (value instanceof JSONArray) { | ||
| 84 | 85 | String s = StringUtil.getString(value); | |
| 85 | 86 | if (s.startsWith("[")) { | |
| 86 | 87 | s = s.substring(1); | |
@@ -93,7 +94,7 @@ public static String parse(final String name, final JSONObject request) { | |||
| 93 | 94 | value = "new Object[]{" + s + "}";//反射获取泛型太麻烦,反正开发中还要改的 | |
| 94 | 95 | } | |
| 95 | 96 | ||
| 96 | - response += NEWLINE + parentKey + ".put(" + pairKey + ", " + value + ");"; | ||
| 97 | + response += NEWLINE + parentKey + ".put(\"" + key + "\", " + value + ");"; | ||
| 97 | 98 | } | |
| 98 | 99 | } | |
| 99 | 100 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -253,7 +253,7 @@ public String delete(@RequestBody String request, HttpSession session) { | |||
| 253 | 253 | ||
| 254 | 254 | ||
| 255 | 255 | /**生成验证码,修改为post请求 | |
| 256 | - * @param phone | ||
| 256 | + * @param request | ||
| 257 | 257 | * @return | |
| 258 | 258 | */ | |
| 259 | 259 | @RequestMapping(value = "post/verify", method = org.springframework.web.bind.annotation.RequestMethod.POST) | |
@@ -290,7 +290,7 @@ public JSONObject postVerify(@RequestBody String request) { | |||
| 290 | 290 | } | |
| 291 | 291 | ||
| 292 | 292 | /**获取验证码 | |
| 293 | - * @param phone | ||
| 293 | + * @param request | ||
| 294 | 294 | * @return | |
| 295 | 295 | */ | |
| 296 | 296 | @RequestMapping(value = "post_get/verify", method = org.springframework.web.bind.annotation.RequestMethod.POST) | |
@@ -307,8 +307,7 @@ public JSONObject getVerify(@RequestBody String request) { | |||
| 307 | 307 | } | |
| 308 | 308 | ||
| 309 | 309 | /**校验验证码 | |
| 310 | - * @param phone | ||
| 311 | - * @param code | ||
| 310 | + * @param request | ||
| 312 | 311 | * @return | |
| 313 | 312 | */ | |
| 314 | 313 | @RequestMapping(value = "post_head/verify", method = org.springframework.web.bind.annotation.RequestMethod.POST) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments