|
@@ -63,10 +63,17 @@ public class CommonLogService {
|
|
// 请求路径
|
|
// 请求路径
|
|
String uri = request.getPath().pathWithinApplication().value();
|
|
String uri = request.getPath().pathWithinApplication().value();
|
|
String requestPath;
|
|
String requestPath;
|
|
|
|
+
|
|
|
|
+ Long userId = null;
|
|
|
|
+ String userName = null;
|
|
|
|
+ String nickName = null;
|
|
if(uri.equals("/service/auth/manage/login")){
|
|
if(uri.equals("/service/auth/manage/login")){
|
|
requestPath = "登录";
|
|
requestPath = "登录";
|
|
}else {
|
|
}else {
|
|
requestPath = getRequestPath(uri);
|
|
requestPath = getRequestPath(uri);
|
|
|
|
+ userId =Long.valueOf( StpUtil.getExtra("userId").toString());
|
|
|
|
+ userName = StpUtil.getExtra("userName").toString();
|
|
|
|
+ nickName = StpUtil.getExtra("nickName").toString();
|
|
}
|
|
}
|
|
String operationType;
|
|
String operationType;
|
|
if(uri.contains("manage")){
|
|
if(uri.contains("manage")){
|
|
@@ -86,11 +93,7 @@ public class CommonLogService {
|
|
operLog.setRequestPath(requestPath);
|
|
operLog.setRequestPath(requestPath);
|
|
operLog.setOperationType(operationType);
|
|
operLog.setOperationType(operationType);
|
|
|
|
|
|
- String userId = StpUtil.getExtra("userId").toString();
|
|
|
|
- String userName = StpUtil.getExtra("userName").toString();
|
|
|
|
- String nickName = StpUtil.getExtra("nickName").toString();
|
|
|
|
-
|
|
|
|
- operLog.setUserId(Long.valueOf(userId));
|
|
|
|
|
|
+ operLog.setUserId(userId);
|
|
operLog.setUserName(userName);
|
|
operLog.setUserName(userName);
|
|
operLog.setNickName(nickName);
|
|
operLog.setNickName(nickName);
|
|
|
|
|
|
@@ -287,6 +290,12 @@ public class CommonLogService {
|
|
ResultData resultData = JSON.parseObject(responseResult, ResultData.class);
|
|
ResultData resultData = JSON.parseObject(responseResult, ResultData.class);
|
|
if(resultData.getCode() == 0){
|
|
if(resultData.getCode() == 0){
|
|
operLog.setResult("操作成功");
|
|
operLog.setResult("操作成功");
|
|
|
|
+ JSONObject jsonObject = (JSONObject) resultData.getData();
|
|
|
|
+ if(operLog.getUserId() == null){
|
|
|
|
+ operLog.setUserId( Long.valueOf(jsonObject.getString("id")));
|
|
|
|
+ operLog.setUserName(jsonObject.getString("userName"));
|
|
|
|
+ operLog.setNickName(jsonObject.getString("nickName"));
|
|
|
|
+ }
|
|
}else {
|
|
}else {
|
|
operLog.setResult("操作失败");
|
|
operLog.setResult("操作失败");
|
|
}
|
|
}
|