完成操作日志的记录
This commit is contained in:
21
src/main/java/cn/iocoder/dashboard/util/json/JSONUtils.java
Normal file
21
src/main/java/cn/iocoder/dashboard/util/json/JSONUtils.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.dashboard.util.json;
|
||||
|
||||
/**
|
||||
* JSON 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public class JSONUtils {
|
||||
|
||||
// public static Map<String, Object> toJSONMap(Object javaObject) {
|
||||
// return (Map<String, Object>) JSON.toJSON(javaObject);
|
||||
// }
|
||||
//
|
||||
// public static void main(String[] args) {
|
||||
// SysDictTypeCreateReqVO createReqVO = new SysDictTypeCreateReqVO();
|
||||
// createReqVO.setType("1");
|
||||
// createReqVO.setRemark("2");
|
||||
// System.out.println(toJSONMap(createReqVO));
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.extra.servlet.ServletUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
@@ -44,4 +45,13 @@ public class ServletUtils {
|
||||
IoUtil.write(response.getOutputStream(), false, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param request 请求
|
||||
* @return ua
|
||||
*/
|
||||
public static String getUserAgent(HttpServletRequest request) {
|
||||
String ua = request.getHeader("User-Agent");
|
||||
return ua != null ? ua : "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user