From ec007d5d818ed2a01c043d27442dacf2e1fae63d Mon Sep 17 00:00:00 2001
From: DismissedLight <1686188646@qq.com>
Date: Tue, 7 Nov 2023 19:08:48 +0800
Subject: [PATCH] add fp to jsbridge
---
.../Web/Bridge/MiHoYoJSInterface.cs | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Bridge/MiHoYoJSInterface.cs b/src/Snap.Hutao/Snap.Hutao/Web/Bridge/MiHoYoJSInterface.cs
index 644a0f7e..360e7a6a 100644
--- a/src/Snap.Hutao/Snap.Hutao/Web/Bridge/MiHoYoJSInterface.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Web/Bridge/MiHoYoJSInterface.cs
@@ -237,14 +237,21 @@ internal class MiHoYoJSInterface
/// Http请求头
public virtual JsResult> GetHttpRequestHeader(JsParam param)
{
+ Dictionary headers = new()
+ {
+ { "x-rpc-client_type", "5" },
+ { "x-rpc-device_id", HoyolabOptions.DeviceId },
+ { "x-rpc-app_version", SaltConstants.CNVersion },
+ };
+
+ if (!userAndUid.IsOversea)
+ {
+ headers.Add("x-rpc-device_fp", userAndUid.User.Fingerprint ?? string.Empty);
+ }
+
return new()
{
- Data = new Dictionary()
- {
- { "x-rpc-client_type", "5" },
- { "x-rpc-device_id", HoyolabOptions.DeviceId },
- { "x-rpc-app_version", SaltConstants.CNVersion },
- },
+ Data = headers,
};
}