|
@@ -66,6 +66,7 @@ import com.lantone.security.enums.ReturnTypeEnum;
|
|
|
import com.lantone.security.client.AuthService;
|
|
|
import com.lantone.security.client.MessageService;
|
|
|
import eu.bitwalker.useragentutils.UserAgent;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -86,6 +87,7 @@ import java.util.stream.Collectors;
|
|
|
* @time: 2021/7/20 12:39
|
|
|
*/
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class UserManagementFacade {
|
|
|
|
|
|
@Autowired
|
|
@@ -150,13 +152,23 @@ public class UserManagementFacade {
|
|
|
sendToTopicDTO.setType("login");
|
|
|
sendToTopicDTO.setTopic(userId);
|
|
|
sendToTopics.add(sendToTopicDTO);
|
|
|
- messageService.sendToTopic(sendToTopics);
|
|
|
+ try {
|
|
|
+ messageService.sendToTopic(sendToTopics);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ log.error(e.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
JwtStore jwtStore = new JwtStore();
|
|
|
jwtStore.setAccessToken(map.get(AuthConstant.ASSESS_TOKEN).toString());
|
|
|
jwtStore.setRefreshToken(map.get(AuthConstant.REFRESH_TOKEN).toString());
|
|
|
jwtStore.setIp(HttpUtils.getIpAddress());
|
|
|
- sysTokenService.createToken(jwtStore);
|
|
|
+ try {
|
|
|
+ sysTokenService.createToken(jwtStore);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ log.error(e.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -856,7 +868,12 @@ public class UserManagementFacade {
|
|
|
// 获取客户端浏览器
|
|
|
String browser = userAgent.getBrowser().getName();
|
|
|
loginLog.setLoginBrowser(browser);
|
|
|
- messageService.loginLogHandle(loginLog);
|
|
|
+ try {
|
|
|
+ messageService.loginLogHandle(loginLog);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ log.error(e.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|