|
@@ -7,11 +7,15 @@ import cn.hutool.http.ContentType;
|
|
|
import cn.hutool.http.useragent.UserAgent;
|
|
|
import cn.hutool.http.useragent.UserAgentUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.common.constant.ServerCode;
|
|
|
+import com.fdkankan.manage.common.CacheUtil;
|
|
|
import com.fdkankan.manage.config.SaTokenConfigure;
|
|
|
+import com.fdkankan.manage.entity.IncrementUseType;
|
|
|
import com.fdkankan.manage.entity.OperLog;
|
|
|
import com.fdkankan.manage.entity.SysUser;
|
|
|
+import com.fdkankan.manage.service.IIncrementUseTypeService;
|
|
|
import com.fdkankan.manage.service.ISysUserService;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -89,6 +93,7 @@ public class VisitLogInterceptor {
|
|
|
JSONObject jsonObject = JSON.parseObject(resultStr);
|
|
|
if(jsonObject.getInteger("code")== null || jsonObject.getInteger("code").equals(ServerCode.SUCCESS.code())){
|
|
|
msg = "操作成功";
|
|
|
+ result = updateResult(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
//获取用户信息 如果已登录,从token中获取用户信息,如果是登录接口,查询数据库获取用户信息
|
|
@@ -133,6 +138,7 @@ public class VisitLogInterceptor {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private String getRequestPath(String uri) {
|
|
|
if(uri.contains("/login")){
|
|
|
return "登录";
|
|
@@ -210,5 +216,29 @@ public class VisitLogInterceptor {
|
|
|
return String.format(browserFormat, browserType, browserVersion);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private Object updateResult(JSONObject jsonObject) {
|
|
|
+ try {
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
+ if(data != null && data.getJSONArray("list")!=null && !data.getJSONArray("list").isEmpty()){
|
|
|
+ JSONArray list = data.getJSONArray("list");
|
|
|
+ for (Object object : list) {
|
|
|
+ JSONObject obj = (JSONObject) object;
|
|
|
+ if(obj.containsKey("useType") && obj.getInteger("useType")!=null ){
|
|
|
+ obj.put("useTypeStr", CacheUtil.useTypeMap.get(obj.getInteger("useType")).getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ log.info("updateResult-error:{}",e);
|
|
|
+ }
|
|
|
+ return jsonObject;
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|