完成操作日志的记录

This commit is contained in:
YunaiV
2021-01-17 00:28:56 +08:00
parent b6457c0418
commit ec8f181f2f
29 changed files with 691 additions and 261 deletions

View 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));
// }
}

View File

@@ -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 : "";
}
}