Ver Fonte

:fire: Removing code or files.

冷冷 há 6 anos atrás
pai
commit
81f4d91b7b

+ 0 - 5
pigx-auth/pom.xml

@@ -72,11 +72,6 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-freemarker</artifactId>
 		</dependency>
-		<!--websocket-->
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-websocket</artifactId>
-		</dependency>
 		<!--spring security 、oauth、jwt依赖-->
 		<dependency>
 			<groupId>org.springframework.cloud</groupId>

+ 1 - 1
pigx-auth/src/main/java/com/pig4cloud/pigx/auth/config/WebSecurityConfigurer.java

@@ -69,7 +69,7 @@ public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
 			.antMatchers(
 				"/token/**",
 				"/actuator/**",
-				"/mobile/**","/ws/**").permitAll()
+				"/mobile/**").permitAll()
 			.anyRequest().authenticated()
 			.and().csrf().disable()
 			.apply(mobileSecurityConfigurer());

+ 0 - 28
pigx-auth/src/main/java/com/pig4cloud/pigx/auth/config/WebSocketConfig.java

@@ -1,28 +0,0 @@
-package com.pig4cloud.pigx.auth.config;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.messaging.simp.config.MessageBrokerRegistry;
-import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
-import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
-import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
-
-/**
- * @author new
- * <p>
- * WebSocket配置类
- */
-@Configuration
-@EnableWebSocketMessageBroker
-public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
-	@Override
-	public void registerStompEndpoints(StompEndpointRegistry registry) {
-		registry.addEndpoint("/ws")
-				.setAllowedOrigins("*")
-				.withSockJS();
-	}
-
-	@Override
-	public void configureMessageBroker(MessageBrokerRegistry registry) {
-		registry.setUserDestinationPrefix("/user/");
-	}
-}

+ 1 - 11
pigx-auth/src/main/java/com/pig4cloud/pigx/auth/handler/PigxAuthenticationSuccessEventHandler.java

@@ -18,10 +18,7 @@
 package com.pig4cloud.pigx.auth.handler;
 
 import com.pig4cloud.pigx.common.security.handler.AbstractAuthenticationSuccessEventHandler;
-import com.pig4cloud.pigx.common.security.service.PigxUser;
-import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.messaging.simp.SimpMessagingTemplate;
 import org.springframework.security.core.Authentication;
 import org.springframework.stereotype.Component;
 
@@ -31,9 +28,7 @@ import org.springframework.stereotype.Component;
  */
 @Slf4j
 @Component
-@AllArgsConstructor
 public class PigxAuthenticationSuccessEventHandler extends AbstractAuthenticationSuccessEventHandler {
-	private final SimpMessagingTemplate simpMessagingTemplate;
 
 	/**
 	 * 处理登录成功方法
@@ -44,11 +39,6 @@ public class PigxAuthenticationSuccessEventHandler extends AbstractAuthenticatio
 	 */
 	@Override
 	public void handle(Authentication authentication) {
-		Object principal = authentication.getPrincipal();
-		log.info("用户:{} 登录成功", principal);
-		PigxUser pigxUser = (PigxUser) principal;
-
-		String user = String.format("%s-%s", pigxUser.getUsername(), pigxUser.getTenantId());
-		simpMessagingTemplate.convertAndSendToUser(user, "/loginRemind", pigxUser.getUsername());
+		log.info("用户:{} 登录成功", authentication.getPrincipal());
 	}
 }