소스 검색

登录日志默认InstId

shimingxy 6 달 전
부모
커밋
e96579bd1c
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/repository/LoginHistoryRepository.java

+ 4 - 0
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/repository/LoginHistoryRepository.java

@@ -19,6 +19,7 @@ package org.dromara.maxkey.persistence.repository;
 
 import java.sql.Types;
 
+import org.apache.commons.lang3.StringUtils;
 import org.dromara.maxkey.entity.history.HistoryLogin;
 import org.dromara.maxkey.web.WebContext;
 import org.slf4j.Logger;
@@ -61,6 +62,9 @@ public class LoginHistoryRepository {
         
     public void login(HistoryLogin historyLogin) {
         historyLogin.setId(WebContext.genId());
+        if(StringUtils.isBlank(historyLogin.getInstId())) {
+        	historyLogin.setInstId("1");
+        }
         //Thread insert 
         new Thread(new HistoryLoginRunnable(jdbcTemplate,historyLogin)).start();
     }