This commit is contained in:
2023-06-24 21:23:17 +08:00
parent ee2c4eb3ba
commit 3fd3a09888
12 changed files with 156 additions and 8 deletions

View File

@ -1,5 +1,7 @@
package com.qiaoba.common.web.utils;
import cn.hutool.http.ContentType;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.qiaoba.common.base.result.AjaxResult;
@ -18,7 +20,7 @@ public class ResponseUtil {
public static void response(HttpServletResponse response, String msg) throws IOException {
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType("text/plain; charset=UTF-8");
response.setContentType(ContentType.JSON.getValue());
PrintWriter writer = response.getWriter();
writer.write(msg);
writer.close();