接口查询 不做日志记录
日志记录为 员工名称
This commit is contained in:
@@ -78,12 +78,14 @@ public class LogAspect {
|
||||
Object o = redisUtils.get("online-token-"+getToken(request));
|
||||
JSONObject jsonObject = null;
|
||||
Integer shopId = null;
|
||||
if (o!= null){
|
||||
String nickName = "";
|
||||
if (o != null) {
|
||||
String jsonString = JSON.toJSONString(o);
|
||||
jsonObject = JSONObject.parseObject(jsonString);
|
||||
shopId = (Integer)jsonObject.get("shopId");
|
||||
shopId = (Integer) jsonObject.get("shopId");
|
||||
nickName = jsonObject.get("nickName") == null ? "" : jsonObject.get("nickName").toString();
|
||||
}
|
||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log, shopId);
|
||||
logService.save(nickName+":"+getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log, shopId);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -107,9 +109,10 @@ public class LogAspect {
|
||||
jsonObject = JSONObject.parseObject(jsonString);
|
||||
shopId = (Integer)jsonObject.get("shopId");
|
||||
}
|
||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log, shopId);
|
||||
logService.save(getUsername()+getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log, shopId);
|
||||
}
|
||||
|
||||
|
||||
public String getUsername() {
|
||||
try {
|
||||
return SecurityUtils.getCurrentUsername();
|
||||
@@ -117,6 +120,7 @@ public class LogAspect {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getToken(HttpServletRequest request) {
|
||||
final String requestHeader = request.getHeader("Authorization");
|
||||
if (requestHeader != null && requestHeader.startsWith("Bearer")) {
|
||||
|
||||
Reference in New Issue
Block a user