Merge remote-tracking branch 'origin/master'

master
薛宏祥 12 months ago
commit 1d5443fe5c
  1. 7
      src/main/java/org/springblade/core/oauth2/endpoint/OAuth2TokenEndPoint.java
  2. 15
      src/main/java/org/springblade/modules/system/mapper/LogApiMapper.xml
  3. 4
      src/main/java/org/springblade/modules/system/pojo/dto/LogDTO.java
  4. 5
      src/main/java/org/springblade/modules/system/service/impl/LogApiServiceImpl.java

@ -1,5 +1,6 @@
package org.springblade.core.oauth2.endpoint;
import com.esotericsoftware.kryo.kryo5.minlog.Log;
import com.wf.captcha.SpecCaptcha;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@ -179,4 +180,10 @@ public class OAuth2TokenEndPoint {
this.authorizationHandler = authorizationHandler;
this.tokenHandler = tokenHandler;
}
@GetMapping({"/oauth/token2"})
@ApiLog(value = "获取登录信息")
public void token2() {
Log.info("获取用户信息");
}
}

@ -35,16 +35,19 @@
WHERE
create_by != ''
<if test="logType == 1">
and method_name = 'token'
and method_name = 'token2'
</if>
<if test="logType == 2">
and method_name != 'token'
and method_name != 'token2'
</if>
<if test="startTime != null and endTime != null">
AND create_time BETWEEN #{startTime} AND #{endTime}
<if test="startTime != null and startTime != ''">
AND create_time <![CDATA[>=]]> CONCAT(#{startTime},' 00:00:00')
</if>
<if test="userId != '' and userId != null">
and create_by = #{userId}
<if test="endTime != null and endTime != ''">
AND create_time <![CDATA[<=]]> CONCAT(#{endTime},' 23:59:59')
</if>
<if test="userName != '' and userName != null">
and create_by = #{userName}
</if>
ORDER BY
create_time DESC

@ -18,6 +18,6 @@ public class LogDTO {
// 日志类型:1登录日志 2修改日志
private String logType;
// 用户id
private String userId;
// 用户账号
private String userName;
}

@ -67,7 +67,7 @@ public class LogApiServiceImpl extends ServiceImpl<LogApiMapper, LogApi> impleme
// 记录年月
AtomicReference<String> yearMonth = new AtomicReference<>(null);
// logs遍历计数器
AtomicInteger count = new AtomicInteger(1);
AtomicInteger count = new AtomicInteger(0);
// logs总长度
int totalLogs = logs.size();
@ -138,9 +138,6 @@ public class LogApiServiceImpl extends ServiceImpl<LogApiMapper, LogApi> impleme
// 最后一次执行的逻辑,将logRecord保存
logRecords.add(logRecord);
}
// 计数器增加
count.incrementAndGet();
}
return logRecords;

Loading…
Cancel
Save