更新JSON

This commit is contained in:
User_cyk committed 2023-07-02 13:51:36 +08:00
1 parent b197f57e3e
commit 04a751f7aa
2 files changed
+2 -2

No files matched your search

@@ -41,7 +41,7 @@ public class countNumServlet extends HttpServlet {
PrintWriter writer = resp.getWriter(); PrintWriter writer = resp.getWriter();
String str= String.valueOf(projectService.countAll()); String str= String.valueOf(projectService.countAll());
str="{num:"+str+"}"; str= "{\"num\":\""+str+"\"}" ;
String jsonString = JSONObject.toJSONString(str); String jsonString = JSONObject.toJSONString(str);
writer.println(jsonString); writer.println(jsonString);
writer.close(); writer.close();
@@ -41,7 +41,7 @@ public class userNumServlet extends HttpServlet {
PrintWriter writer = resp.getWriter(); PrintWriter writer = resp.getWriter();
long num = userService.queryUserCount(); long num = userService.queryUserCount();
String str= "{num:"+num+"}" ; String str= "{\"num\":\""+num+"\"}" ;
String jsonString = JSONObject.toJSONString(str); String jsonString = JSONObject.toJSONString(str);
writer.println(jsonString); writer.println(jsonString);
if(num == 0) if(num == 0)