diff --git a/pom.xml b/pom.xml
index 531abb2..c46e33f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,6 +123,12 @@
runtime
8.0.33
+
+ com.google.code.gson
+ gson
+ 2.10.1
+
+
com.h2database
@@ -144,6 +150,20 @@
3.1.1
+
+
+ com.aliyun
+ alibabacloud-push20160801
+ 1.0.13
+
+
+
+
+ com.aliyun
+ push20160801
+ 1.0.17
+
+
io.jsonwebtoken
diff --git a/src/main/java/com/onekeycall/videotablet/interceptor/AuthHandshakeInterceptor.java b/src/main/java/com/onekeycall/videotablet/interceptor/AuthHandshakeInterceptor.java
index 898a1a1..4a32759 100644
--- a/src/main/java/com/onekeycall/videotablet/interceptor/AuthHandshakeInterceptor.java
+++ b/src/main/java/com/onekeycall/videotablet/interceptor/AuthHandshakeInterceptor.java
@@ -18,13 +18,14 @@ public class AuthHandshakeInterceptor implements HandshakeInterceptor {
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map attributes) throws Exception {
- String userId = request.getHeaders().getFirst("user_id");
String authHeader = request.getHeaders().getFirst("Authorization");
+ String deviceId = request.getHeaders().getFirst("Device-ID");
+ String userId = request.getHeaders().getFirst("user_id");
+
if (authHeader == null || !authHeader.startsWith("Bearer ")) {
return false;
}
String token = authHeader.substring(7); // 去掉 "Bearer " 前缀
- String deviceId = request.getHeaders().getFirst("Device-ID");
return jwtUtil.validateAccessToken(userId, token, deviceId); // 自定义校验逻辑
}
diff --git a/src/main/java/com/onekeycall/videotablet/utils/PushUtils.java b/src/main/java/com/onekeycall/videotablet/utils/PushUtils.java
index 0b25cba..d745cb7 100644
--- a/src/main/java/com/onekeycall/videotablet/utils/PushUtils.java
+++ b/src/main/java/com/onekeycall/videotablet/utils/PushUtils.java
@@ -1,4 +1,55 @@
package com.onekeycall.videotablet.utils;
+import com.aliyun.auth.credentials.Credential;
+import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
+import com.aliyun.credentials.models.Config;
+import com.aliyun.sdk.service.dysmsapi20170525.AsyncClient;
+import com.aliyun.sdk.service.push20160801.models.PushRequest;
+import com.aliyun.sdk.service.push20160801.models.PushResponse;
+import com.google.gson.Gson;
+import darabonba.core.client.ClientOverrideConfiguration;
+
+import java.util.concurrent.CompletableFuture;
+import com.aliyun.tea.*;
+import com.aliyun.push20160801.*;
+import com.aliyun.push20160801.models.*;
+import com.aliyun.teaopenapi.*;
+import com.aliyun.teaopenapi.models.*;
+import com.aliyun.teautil.*;
+
public class PushUtils {
+// public static com.aliyun.push20160801.Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
+// Config config = new Config();
+// // 您的AccessKey ID
+// config.accessKeyId = accessKeyId;
+// // 您的AccessKey Secret
+// config.accessKeySecret = accessKeySecret;
+// config.regionId = "cn-hangzhou";
+// return new com.aliyun.push20160801.Client(config);
+// }
+//
+// public static void aliyunAsyncPush( String message, String title) {
+//
+// java.util.List args = java.util.Arrays.asList(args_);
+// com.aliyun.push20160801.Client client = Sample.createClient(com.aliyun.darabonba.env.EnvClient.getEnv("ACCESS_KEY_ID"), com.aliyun.darabonba.env.EnvClient.getEnv("ACCESS_KEY_SECRET"));
+// PushRequest request = new PushRequest()
+// .setAppKey(com.aliyun.darabonbanumber.Client.parseLong(args.get(0)))
+// .setPushType("MESSAGE")
+// .setDeviceType("ALL")
+// .setStoreOffline(true)
+// .setIOSRemind(true)
+// .setAndroidRemind(true)
+// .setTarget("DEVICE")
+// .setTargetValue(args.get(1))
+// .setTitle(args.get(2))
+// .setBody(args.get(3))
+// .setIOSRemindBody(args.get(4))
+// .setAndroidPopupTitle(args.get(5))
+// .setAndroidPopupBody(args.get(6));
+// PushResponse response = client.push(request);
+// com.aliyun.teaconsole.Client.log(com.aliyun.teautil.Common.toJSONString(TeaModel.buildMap(response.body)));
+// }
+
+
+
}