ソースを参照

修改权限获取方式

zhouhao 7 年 前
コミット
2018be7b56

+ 10 - 7
hsweb-message/hsweb-message-websocket/src/main/java/org/hswebframework/web/socket/handler/WebSocketUtils.java

@@ -36,13 +36,16 @@ public class WebSocketUtils {
                         .add(tmp[1].trim());
                         .add(tmp[1].trim());
         }
         }
 
 
-        Function<Set<String>, Optional<Authentication>> userGetter = set ->
+        // TODO: 2017/7/12  修改权限获取方式
-                set == null ? Optional.empty() : set.stream()
+        throw new UnsupportedOperationException();
-                        .map(container::getByToken)
+//        Function<Set<String>, Optional<Authentication>> userGetter = set ->
-                        .filter(Objects::nonNull).findFirst();
+//                set == null ? Optional.empty() : set.stream()
-
+//                        .map(container::getByToken)
-        return userGetter.apply(sessionId.get("SESSION"))
+//                        .filter(Objects::nonNull)
-                .orElseGet(() -> userGetter.apply(sessionId.get("JSESSIONID")).orElse(null));
+//                        .findFirst();
+//
+//        return userGetter.apply(sessionId.get("SESSION"))
+//                .orElseGet(() -> userGetter.apply(sessionId.get("JSESSIONID")).orElse(null));
 
 
     }
     }
 }
 }