Fancy
2024-10-30 e487d886533bb60618864642b85f13957252f70d
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/aop/LogAspect.java
@@ -25,6 +25,9 @@
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.util.UriComponentsBuilder;
import java.lang.reflect.Array;
import java.util.Arrays;
@Slf4j
@Aspect
@Component
@@ -62,7 +65,10 @@
                // 获取IP地址
                String ip = getRemoteHost();
                // 记录日志
                logSv.save(user.id,user.name, operationName,ip,result.getCode(),result.getMsg());
                //msg  方法名 + 参数值 + 返回值
                String args = JSONObject.toJSONString(joinPoint.getArgs());
                //String args1 = Arrays.toString(joinPoint.getArgs());
                logSv.save(user.id,user.name, operationName,ip,result.getCode(),args+" "+ result.getMsg());
            }
        }catch (Exception e){
            log.error("记录日志异常:"+e.getMessage());