com.xd.sdk.account 7.1.0 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Plugins/Android/libs/XDGAccount_7.1.2.aar +0 -0
- package/Plugins/Android/libs/XDGSupport_7.1.2.aar +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/Headers/XDGAccountVersion.h +3 -3
- package/Plugins/iOS/XDAccountSDK.framework/Info.plist +0 -0
- package/Plugins/iOS/XDAccountSDK.framework/XDAccountSDK +0 -0
- package/Runtime/Internal/Mobile/AccountFeaturesImpl.cs +6 -6
- package/Runtime/Internal/Mobile/Http/MacAuthenticationInterceptor.cs +2 -2
- package/Runtime/Internal/Standalone/AccessToken/AccessTokenModule.cs +1 -1
- package/Runtime/Internal/Standalone/AccountFeaturesImpl.cs +11 -11
- package/Runtime/Internal/Standalone/Auth/TapAuth.cs +3 -3
- package/Runtime/Internal/Standalone/Auth/WebAuth.cs +4 -4
- package/Runtime/Internal/Standalone/SupportModule/SupportModule.cs +7 -7
- package/Runtime/Internal/Standalone/UI/PhoneVerification/RiskControlAlert.cs +72 -32
- package/Runtime/Internal/Standalone/UserCenterAlert.cs +9 -9
- package/Runtime/Internal/Standalone/UserModule.cs +13 -13
- package/Runtime/Internal/Standalone/WebFunction/AccessTokenWebFunction.cs +1 -1
- package/Runtime/Internal/XDGAccountInternal.cs +1 -1
- package/Runtime/Public/XDGAccount.cs +1 -1
- package/package.json +2 -2
- package/Plugins/Android/libs/XDGAccount_7.1.0.aar +0 -0
- package/Plugins/Android/libs/XDGSupport_7.1.0.aar +0 -0
- /package/Plugins/Android/libs/{XDGAccount_7.1.0.aar.meta → XDGAccount_7.1.2.aar.meta} +0 -0
- /package/Plugins/Android/libs/{XDGBridgeAccount_v7_7.1.0.aar → XDGBridgeAccount_v7_7.1.2.aar} +0 -0
- /package/Plugins/Android/libs/{XDGBridgeAccount_v7_7.1.0.aar.meta → XDGBridgeAccount_v7_7.1.2.aar.meta} +0 -0
- /package/Plugins/Android/libs/{XDGSupport_7.1.0.aar.meta → XDGSupport_7.1.2.aar.meta} +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -171,7 +171,7 @@ namespace XD.SDK.Account.Internal.Mobile
|
|
|
171
171
|
}
|
|
172
172
|
catch (Exception e)
|
|
173
173
|
{
|
|
174
|
-
XDGLogger.Warn("convert current user error" + e.Message);
|
|
174
|
+
XDGLogger.Warn("convert current user error" + e.Message, XDGLoggerTag.Bridge);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -243,7 +243,7 @@ namespace XD.SDK.Account.Internal.Mobile
|
|
|
243
243
|
|
|
244
244
|
EngineBridge.GetInstance().CallHandler(command, result =>
|
|
245
245
|
{
|
|
246
|
-
XDGLogger.Debug("bindByType 方法结果: " + result.ToJson());
|
|
246
|
+
XDGLogger.Debug("bindByType 方法结果: " + result.ToJson(), XDGLoggerTag.Bridge);
|
|
247
247
|
|
|
248
248
|
var xdgError = result.Parse2XDGError();
|
|
249
249
|
if (xdgError != null)
|
|
@@ -311,7 +311,7 @@ namespace XD.SDK.Account.Internal.Mobile
|
|
|
311
311
|
var sessionToken = XDDictionary.GetValue<string>(response.Data, "sessionToken");
|
|
312
312
|
if (string.IsNullOrEmpty(sessionToken))
|
|
313
313
|
{
|
|
314
|
-
XDGLogger.Warn("[SyncTDSUser] sessionToken is Null!");
|
|
314
|
+
XDGLogger.Warn("[SyncTDSUser] sessionToken is Null!", XDGLoggerTag.Bridge);
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
317
|
|
|
@@ -319,7 +319,7 @@ namespace XD.SDK.Account.Internal.Mobile
|
|
|
319
319
|
}
|
|
320
320
|
catch (Exception e)
|
|
321
321
|
{
|
|
322
|
-
XDGLogger.Warn($"[SyncTDSUser] error:{e.Message}");
|
|
322
|
+
XDGLogger.Warn($"[SyncTDSUser] error:{e.Message}", XDGLoggerTag.Bridge);
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
|
|
@@ -329,11 +329,11 @@ namespace XD.SDK.Account.Internal.Mobile
|
|
|
329
329
|
using (var accountBridgeClass = new AndroidJavaClass(BridgeConstants.Account.BridgeStaticImpl))
|
|
330
330
|
{
|
|
331
331
|
var fbToken = accountBridgeClass.CallStatic<string>("getFacebookToken");
|
|
332
|
-
XDGLogger.Debug($"[GetFacebookToken] fbToken:{fbToken}");
|
|
332
|
+
XDGLogger.Debug($"[GetFacebookToken] fbToken:{fbToken}", XDGLoggerTag.Bridge);
|
|
333
333
|
var tokenDic = JsonConvert.DeserializeObject<Dictionary<string, object>>(fbToken);
|
|
334
334
|
if (tokenDic.ContainsKey("error"))
|
|
335
335
|
{
|
|
336
|
-
XDGLogger.Warn($"[GetFacebookToken] error:{JsonConvert.SerializeObject(tokenDic)}");
|
|
336
|
+
XDGLogger.Warn($"[GetFacebookToken] error:{JsonConvert.SerializeObject(tokenDic)}", XDGLoggerTag.Bridge);
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
339
|
var token = XDDictionary.GetValue<string>(tokenDic, "access_token");
|
|
@@ -14,7 +14,7 @@ namespace XD.SDK.Account.Internal.Mobile
|
|
|
14
14
|
{
|
|
15
15
|
protected override async Task BeforeRequestAsync(IHttpRequest request, CancellationToken cancellationToken)
|
|
16
16
|
{
|
|
17
|
-
XDGLogger.Debug($"[MacAuthenticationInterceptor] request Url: {JsonConvert.SerializeObject(request.Url)}");
|
|
17
|
+
XDGLogger.Debug($"[MacAuthenticationInterceptor] request Url: {JsonConvert.SerializeObject(request.Url)}", XDGLoggerTag.Http);
|
|
18
18
|
|
|
19
19
|
var authDic = await GetMacToken(request.Url, request.Method);
|
|
20
20
|
var authToken = "";
|
|
@@ -24,7 +24,7 @@ namespace XD.SDK.Account.Internal.Mobile
|
|
|
24
24
|
request.Headers["Authorization"] = authToken;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
XDGLogger.Debug($"[MacAuthenticationInterceptor] request Headers: {JsonConvert.SerializeObject(request.Headers)}");
|
|
27
|
+
XDGLogger.Debug($"[MacAuthenticationInterceptor] request Headers: {JsonConvert.SerializeObject(request.Headers)}", XDGLoggerTag.Http);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
private static Task<Dictionary<string, string>> GetMacToken(string requestUrl, HttpMethod method)
|
|
@@ -88,7 +88,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
88
88
|
}
|
|
89
89
|
catch (Exception e)
|
|
90
90
|
{
|
|
91
|
-
XDGLogger.Error(new XDGError(ResponseCode.Common.Failed, e.Message));
|
|
91
|
+
XDGLogger.Error(new XDGError(ResponseCode.Common.Failed, e.Message), XDGLoggerTag.Account);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -107,7 +107,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
107
107
|
var user = UserModule.current;
|
|
108
108
|
if (user == null)
|
|
109
109
|
{
|
|
110
|
-
XDGLogger.Warn("请先登录");
|
|
110
|
+
XDGLogger.Warn("请先登录", XDGLoggerTag.Account);
|
|
111
111
|
UIManager.ShowToast(XDLocalization.GetCurrentLocalizableString().NotLogin);
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
@@ -128,7 +128,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
128
128
|
var user = UserModule.current;
|
|
129
129
|
if (user == null)
|
|
130
130
|
{
|
|
131
|
-
XDGLogger.Warn("请先登录");
|
|
131
|
+
XDGLogger.Warn("请先登录", XDGLoggerTag.Account);
|
|
132
132
|
UIManager.ShowToast(XDLocalization.GetCurrentLocalizableString().NotLogin);
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
@@ -182,7 +182,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
182
182
|
}
|
|
183
183
|
catch (Exception e)
|
|
184
184
|
{
|
|
185
|
-
XDGLogger.Error(new XDGError(ResponseCode.Common.Failed, e.Message));
|
|
185
|
+
XDGLogger.Error(new XDGError(ResponseCode.Common.Failed, e.Message), XDGLoggerTag.Account);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -194,7 +194,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
194
194
|
}
|
|
195
195
|
catch (XDGError e)
|
|
196
196
|
{
|
|
197
|
-
XDGLogger.Error(new XDGError(ResponseCode.Common.Failed, e.ErrorMsg));
|
|
197
|
+
XDGLogger.Error(new XDGError(ResponseCode.Common.Failed, e.ErrorMsg), XDGLoggerTag.Account);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
|
|
@@ -279,6 +279,8 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
279
279
|
{
|
|
280
280
|
// SDK 登陆成功
|
|
281
281
|
AliyunTrack.LoginLogout(logoutType);
|
|
282
|
+
|
|
283
|
+
ClearUserCache();
|
|
282
284
|
|
|
283
285
|
XDGEventBus.Publish(XDGEvents.TdsSDKLogout);
|
|
284
286
|
XDGEventBus.Publish(XDGEvents.TapSDKLogout);
|
|
@@ -286,8 +288,6 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
286
288
|
{
|
|
287
289
|
XDGEventBus.Publish(XDGEvents.TapSDKComplianceExit, ConfigModule.IsGlobal);
|
|
288
290
|
}
|
|
289
|
-
|
|
290
|
-
ClearUserCache();
|
|
291
291
|
|
|
292
292
|
if (bShowAgreement)
|
|
293
293
|
{
|
|
@@ -321,7 +321,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
321
321
|
var current = UserModule.current;
|
|
322
322
|
if (current == null)
|
|
323
323
|
{
|
|
324
|
-
XDGLogger.Warn("请先登录");
|
|
324
|
+
XDGLogger.Warn("请先登录", XDGLoggerTag.Account);
|
|
325
325
|
UIManager.ShowToast(XDLocalization.GetCurrentLocalizableString().NotLogin);
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
@@ -329,7 +329,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
329
329
|
string cancelUrl = ConfigModule.CancelUrl;
|
|
330
330
|
if (string.IsNullOrEmpty(cancelUrl))
|
|
331
331
|
{
|
|
332
|
-
XDGLogger.Warn("没有有效的注销 url");
|
|
332
|
+
XDGLogger.Warn("没有有效的注销 url", XDGLoggerTag.Account);
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
335
|
|
|
@@ -360,7 +360,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
var url = $"{cancelUrl}?{XDUrlUtils.ToQueryString(queryParams)}";
|
|
363
|
-
XDGLogger.Debug($"cancel url: {url}");
|
|
363
|
+
XDGLogger.Debug($"cancel url: {url}", XDGLoggerTag.Account);
|
|
364
364
|
|
|
365
365
|
// 打开内置浏览器
|
|
366
366
|
var data = new Dictionary<string, object>
|
|
@@ -390,7 +390,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
390
390
|
}
|
|
391
391
|
catch (Exception e)
|
|
392
392
|
{
|
|
393
|
-
XDGLogger.Warn($"[InvokeXdgPaymentCheckRefundStatusWithUI] Error:{e.Message}");
|
|
393
|
+
XDGLogger.Warn($"[InvokeXdgPaymentCheckRefundStatusWithUI] Error:{e.Message}", XDGLoggerTag.Account);
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
return user;
|
|
@@ -50,20 +50,20 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
50
50
|
// {
|
|
51
51
|
// if (e.code == (int)TapErrorCode.ERROR_CODE_LOGIN_CANCEL)
|
|
52
52
|
// {
|
|
53
|
-
// XDGLogger.Debug($"Tap 取消登录,{e}");
|
|
53
|
+
// XDGLogger.Debug($"Tap 取消登录,{e}", XDGLoggerTag.Account);
|
|
54
54
|
// AliyunTrack.LoginAuthorizeFail(e.Message);
|
|
55
55
|
// throw XDGErrorExtensions.CancelledError(e.message);
|
|
56
56
|
// }
|
|
57
57
|
// else
|
|
58
58
|
// {
|
|
59
|
-
// XDGLogger.Warn($"Tap 登录失败:{e}");
|
|
59
|
+
// XDGLogger.Warn($"Tap 登录失败:{e}", XDGLoggerTag.Account);
|
|
60
60
|
// throw new XDGError(ResponseCode.Common.Failed, e.Message);
|
|
61
61
|
// }
|
|
62
62
|
// }
|
|
63
63
|
catch (Exception e)
|
|
64
64
|
{
|
|
65
65
|
AliyunTrack.LoginAuthorizeFail(e.Message);
|
|
66
|
-
XDGLogger.Warn($"Tap 登录失败:{e}");
|
|
66
|
+
XDGLogger.Warn($"Tap 登录失败:{e}", XDGLoggerTag.Account);
|
|
67
67
|
throw new XDGError(ResponseCode.Common.Failed, e.Message);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -56,7 +56,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
56
56
|
string authRequest = $"{url}?{string.Join("&", queryPairs)}";
|
|
57
57
|
|
|
58
58
|
// 弹出授权页
|
|
59
|
-
XDGLogger.Debug($"auth: {authRequest}");
|
|
59
|
+
XDGLogger.Debug($"auth: {authRequest}", XDGLoggerTag.Account);
|
|
60
60
|
AliyunTrack.LoginAuthorize();
|
|
61
61
|
// 登陆跳转授权 Track
|
|
62
62
|
Application.OpenURL(Uri.EscapeUriString(authRequest));
|
|
@@ -79,8 +79,8 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
79
79
|
{
|
|
80
80
|
HttpListenerContext context = await server.GetContextAsync();
|
|
81
81
|
|
|
82
|
-
XDGLogger.Debug($"Request url: {context.Request.RawUrl}");
|
|
83
|
-
XDGLogger.Debug($"Request method: {context.Request.HttpMethod}");
|
|
82
|
+
XDGLogger.Debug($"Request url: {context.Request.RawUrl}", XDGLoggerTag.Account);
|
|
83
|
+
XDGLogger.Debug($"Request method: {context.Request.HttpMethod}", XDGLoggerTag.Account);
|
|
84
84
|
|
|
85
85
|
context.Response.StatusCode = 200;
|
|
86
86
|
context.Response.Close();
|
|
@@ -129,7 +129,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
129
129
|
}
|
|
130
130
|
catch (Exception e)
|
|
131
131
|
{
|
|
132
|
-
XDGLogger.Debug(e.Message);
|
|
132
|
+
XDGLogger.Debug(e.Message, XDGLoggerTag.Account);
|
|
133
133
|
// 异常结果则一直 pending
|
|
134
134
|
// 登陆授权失败
|
|
135
135
|
AliyunTrack.LoginAuthorizeFail(e.Message);
|
|
@@ -46,7 +46,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
XDGLogger.Debug("XSupportManager is disabled by config, skipping polling start");
|
|
49
|
+
XDGLogger.Debug("XSupportManager is disabled by config, skipping polling start", XDGLoggerTag.Support);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
private const string XdgSupportUserUnreadCheck = "api/support/v1/user/unread/check";
|
|
@@ -85,7 +85,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
85
85
|
|
|
86
86
|
private static async void CheckUnRead()
|
|
87
87
|
{
|
|
88
|
-
XDGLogger.Debug("Support check unread");
|
|
88
|
+
XDGLogger.Debug("Support check unread", XDGLoggerTag.Support);
|
|
89
89
|
try
|
|
90
90
|
{
|
|
91
91
|
string requestUrl;
|
|
@@ -112,7 +112,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
112
112
|
Instance.bLastHasRead = bHasUnRead;
|
|
113
113
|
var nextTimeInterval = bUnReadStatusChange ? 10 : IncreaseTimeInterval();
|
|
114
114
|
Instance.nextCheckUnreadTime = response.Data.IntervalSec > 0 ? response.Data.IntervalSec : nextTimeInterval;
|
|
115
|
-
XDGLogger.Debug($"Support Check UnRead Success, hasUnread:{response.Data.HasUnread} interval:{response.Data.IntervalSec}");
|
|
115
|
+
XDGLogger.Debug($"Support Check UnRead Success, hasUnread:{response.Data.HasUnread} interval:{response.Data.IntervalSec}", XDGLoggerTag.Support);
|
|
116
116
|
if (bUnReadStatusChange)
|
|
117
117
|
{
|
|
118
118
|
AccountFeaturesImpl.Instance.GetUserStatusCallback()
|
|
@@ -142,7 +142,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
142
142
|
}
|
|
143
143
|
catch (ObjectDisposedException e)
|
|
144
144
|
{
|
|
145
|
-
XDGLogger.Warn($"Support Cancel CheckUnRead Action error:{e.Message}");
|
|
145
|
+
XDGLogger.Warn($"Support Cancel CheckUnRead Action error:{e.Message}", XDGLoggerTag.Support);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
Instance.cts = new CancellationTokenSource();
|
|
@@ -158,7 +158,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
158
158
|
}
|
|
159
159
|
catch (TaskCanceledException e)
|
|
160
160
|
{
|
|
161
|
-
XDGLogger.Warn($"Support Start CheckUnRead Action error:{e.Message}");
|
|
161
|
+
XDGLogger.Warn($"Support Start CheckUnRead Action error:{e.Message}", XDGLoggerTag.Support);
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
return;
|
|
@@ -169,7 +169,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
169
169
|
|
|
170
170
|
private static async void RequestSupportUrl(XDGRoleInfo roleInfo, string path, Dictionary<string, object> extra, Action<bool, bool, string> action)
|
|
171
171
|
{
|
|
172
|
-
XDGLogger.Debug("Support RequestSupportUrl");
|
|
172
|
+
XDGLogger.Debug("Support RequestSupportUrl", XDGLoggerTag.Support);
|
|
173
173
|
try
|
|
174
174
|
{
|
|
175
175
|
path = path ?? "";
|
|
@@ -216,7 +216,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
216
216
|
}
|
|
217
217
|
catch (XDGError e)
|
|
218
218
|
{
|
|
219
|
-
XDGLogger.Warn($"Support RequestSupportUrl error:{e.ErrorMsg}");
|
|
219
|
+
XDGLogger.Warn($"Support RequestSupportUrl error:{e.ErrorMsg}", XDGLoggerTag.Support);
|
|
220
220
|
action.Invoke(false, false, null);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
@@ -11,8 +11,10 @@ using Vuplex.WebView;
|
|
|
11
11
|
using XD.SDK.Common;
|
|
12
12
|
using XD.SDK.Common.Internal.Standalone;
|
|
13
13
|
|
|
14
|
-
namespace XD.SDK.Account.Internal.Standalone
|
|
15
|
-
|
|
14
|
+
namespace XD.SDK.Account.Internal.Standalone
|
|
15
|
+
{
|
|
16
|
+
public class RiskControlAlert : UIElement
|
|
17
|
+
{
|
|
16
18
|
public const int CONTROL_DONE_CODE = 0;
|
|
17
19
|
public const int CLOSE_CODE = -1;
|
|
18
20
|
public const int BACK_CODE = 1;
|
|
@@ -22,59 +24,87 @@ namespace XD.SDK.Account.Internal.Standalone {
|
|
|
22
24
|
|
|
23
25
|
private CanvasWebViewPrefab canvasWebViewPrefab;
|
|
24
26
|
|
|
25
|
-
public static async Task<int> Control(Func<string, Task<RequestVerifyCodeData>> requestVerifyCodeFunc)
|
|
27
|
+
public static async Task<int> Control(Func<string, Task<RequestVerifyCodeData>> requestVerifyCodeFunc)
|
|
28
|
+
{
|
|
26
29
|
RiskControlAlert alert = null;
|
|
27
30
|
string riskControlData = null;
|
|
28
31
|
TaskCompletionSource<int> tcs = new TaskCompletionSource<int>();
|
|
29
|
-
try
|
|
32
|
+
try
|
|
33
|
+
{
|
|
30
34
|
UIManager.ShowLoading(true);
|
|
31
35
|
RequestVerifyCodeData verifyCodeData = await requestVerifyCodeFunc(riskControlData);
|
|
32
36
|
tcs.TrySetResult(verifyCodeData.ReSendInterval);
|
|
33
|
-
}
|
|
34
|
-
|
|
37
|
+
}
|
|
38
|
+
catch (XDGError e)
|
|
39
|
+
{
|
|
40
|
+
if (e.Code == PhoneModule.RISK_CONTROL)
|
|
41
|
+
{
|
|
35
42
|
// 触发风控
|
|
36
|
-
alert = UIManager.ShowUI<RiskControlAlert>("XDRiskControlAlert", null, async (code, data) =>
|
|
37
|
-
|
|
43
|
+
alert = UIManager.ShowUI<RiskControlAlert>("XDRiskControlAlert", null, async (code, data) =>
|
|
44
|
+
{
|
|
45
|
+
if (code == CLOSE_CODE)
|
|
46
|
+
{
|
|
38
47
|
UIManager.Dismiss();
|
|
39
48
|
tcs.TrySetException(XDGErrorExtensions.CancelledError());
|
|
40
|
-
}
|
|
49
|
+
}
|
|
50
|
+
else if (code == BACK_CODE)
|
|
51
|
+
{
|
|
41
52
|
UIManager.Dismiss();
|
|
42
|
-
}
|
|
53
|
+
}
|
|
54
|
+
else if (code == CONTROL_DONE_CODE)
|
|
55
|
+
{
|
|
43
56
|
riskControlData = data as string;
|
|
44
|
-
try
|
|
57
|
+
try
|
|
58
|
+
{
|
|
45
59
|
UIManager.ShowLoading();
|
|
46
60
|
RequestVerifyCodeData result = await requestVerifyCodeFunc(riskControlData);
|
|
47
61
|
tcs.TrySetResult(result.ReSendInterval);
|
|
48
|
-
}
|
|
62
|
+
}
|
|
63
|
+
catch (XDGError ex)
|
|
64
|
+
{
|
|
49
65
|
UIManager.DismissLoading();
|
|
50
|
-
if (ex.Code == PhoneModule.RISK_CONTROL)
|
|
66
|
+
if (ex.Code == PhoneModule.RISK_CONTROL)
|
|
67
|
+
{
|
|
51
68
|
// 触发风控
|
|
52
69
|
await alert.Reload();
|
|
53
|
-
}
|
|
70
|
+
}
|
|
71
|
+
else if (ex.Code == PhoneModule.RISK_CONTROL_FAILED)
|
|
72
|
+
{
|
|
54
73
|
// 滑动验证失败
|
|
55
74
|
await alert.Reload();
|
|
56
75
|
UIManager.ShowToast(e.Message);
|
|
57
|
-
}
|
|
76
|
+
}
|
|
77
|
+
else
|
|
78
|
+
{
|
|
58
79
|
tcs.TrySetException(ex);
|
|
59
80
|
}
|
|
60
|
-
}
|
|
81
|
+
}
|
|
82
|
+
finally
|
|
83
|
+
{
|
|
61
84
|
UIManager.DismissLoading();
|
|
62
85
|
}
|
|
63
86
|
}
|
|
64
87
|
});
|
|
65
|
-
}
|
|
88
|
+
}
|
|
89
|
+
else
|
|
90
|
+
{
|
|
66
91
|
tcs.TrySetException(e);
|
|
67
92
|
}
|
|
68
|
-
}
|
|
93
|
+
}
|
|
94
|
+
catch (Exception e)
|
|
95
|
+
{
|
|
69
96
|
tcs.TrySetException(e);
|
|
70
|
-
}
|
|
97
|
+
}
|
|
98
|
+
finally
|
|
99
|
+
{
|
|
71
100
|
UIManager.DismissLoading();
|
|
72
101
|
}
|
|
73
102
|
|
|
74
103
|
return await tcs.Task;
|
|
75
104
|
}
|
|
76
105
|
|
|
77
|
-
private void Awake()
|
|
106
|
+
private void Awake()
|
|
107
|
+
{
|
|
78
108
|
Transform webviewContainer = transform.Find("WebViewContainer");
|
|
79
109
|
canvasWebViewPrefab = CanvasWebViewPrefab.Instantiate();
|
|
80
110
|
canvasWebViewPrefab.transform.SetParent(webviewContainer);
|
|
@@ -89,19 +119,21 @@ namespace XD.SDK.Account.Internal.Standalone {
|
|
|
89
119
|
closeButton.onClick.AddListener(OnCloseClicked);
|
|
90
120
|
}
|
|
91
121
|
|
|
92
|
-
private async void Start()
|
|
122
|
+
private async void Start()
|
|
123
|
+
{
|
|
93
124
|
UIManager.ShowLoading();
|
|
94
125
|
|
|
95
126
|
await canvasWebViewPrefab.WaitUntilInitialized();
|
|
96
127
|
|
|
97
128
|
canvasWebViewPrefab.DragMode = DragMode.DragWithinPage;
|
|
98
129
|
|
|
99
|
-
canvasWebViewPrefab.WebView.MessageEmitted += (sender, eventArgs) =>
|
|
100
|
-
|
|
130
|
+
canvasWebViewPrefab.WebView.MessageEmitted += (sender, eventArgs) =>
|
|
131
|
+
{
|
|
132
|
+
XDGLogger.Debug(eventArgs.Value, XDGLoggerTag.Web);
|
|
101
133
|
Dictionary<string, string> response = JsonConvert.DeserializeObject<Dictionary<string, string>>(eventArgs.Value);
|
|
102
134
|
Dictionary<string, object> data = JsonConvert.DeserializeObject<Dictionary<string, object>>(response["message"]);
|
|
103
135
|
string riskControlData = JsonConvert.SerializeObject(data["data"]);
|
|
104
|
-
XDGLogger.Debug(riskControlData);
|
|
136
|
+
XDGLogger.Debug(riskControlData, XDGLoggerTag.Web);
|
|
105
137
|
UIManager.Dismiss();
|
|
106
138
|
|
|
107
139
|
OnCallback(CONTROL_DONE_CODE, riskControlData);
|
|
@@ -121,7 +153,7 @@ namespace XD.SDK.Account.Internal.Standalone {
|
|
|
121
153
|
NetworkInterfaceType _type2 = NetworkInterfaceType.Ethernet;
|
|
122
154
|
|
|
123
155
|
if ((item.NetworkInterfaceType == _type1 || item.NetworkInterfaceType == _type2) && item.OperationalStatus == OperationalStatus.Up)
|
|
124
|
-
#endif
|
|
156
|
+
#endif
|
|
125
157
|
{
|
|
126
158
|
foreach (UnicastIPAddressInformation ip in item.GetIPProperties().UnicastAddresses)
|
|
127
159
|
{
|
|
@@ -129,17 +161,21 @@ namespace XD.SDK.Account.Internal.Standalone {
|
|
|
129
161
|
if (ip.Address.AddressFamily == AddressFamily.InterNetwork)
|
|
130
162
|
{
|
|
131
163
|
output = ip.Address.ToString();
|
|
132
|
-
XDGLogger.Debug($"ip local: {output}");
|
|
164
|
+
XDGLogger.Debug($"ip local: {output}", XDGLoggerTag.Web);
|
|
133
165
|
}
|
|
134
166
|
}
|
|
135
167
|
}
|
|
136
168
|
}
|
|
169
|
+
|
|
137
170
|
return output;
|
|
138
171
|
}
|
|
139
|
-
|
|
172
|
+
|
|
173
|
+
private async Task Reload()
|
|
174
|
+
{
|
|
140
175
|
UIManager.ShowLoading();
|
|
141
176
|
var ip = GetIP();
|
|
142
|
-
canvasWebViewPrefab.WebView.LoadUrl(
|
|
177
|
+
canvasWebViewPrefab.WebView.LoadUrl(
|
|
178
|
+
$"https://login-xdsdk.xd.cn/awsc?platform={Platform}&eventSessionId={AliyunTrack.LoginEventSessionId}&login_type=Phone&sub_login_type=2&xd_client_id={ConfigModule.ClientId}&device_id={SystemInfo.deviceUniqueIdentifier}&os={SystemInfo.operatingSystem}&ip={ip}&app_version={Application.version}&language={XDLocalization.CurrentLang.ToString()}");
|
|
143
179
|
await canvasWebViewPrefab.WebView.WaitForNextPageLoadToFinish();
|
|
144
180
|
// 注入 js
|
|
145
181
|
_ = canvasWebViewPrefab.WebView.ExecuteJavaScript(@";(function (window) {
|
|
@@ -157,8 +193,10 @@ namespace XD.SDK.Account.Internal.Standalone {
|
|
|
157
193
|
UIManager.DismissLoading();
|
|
158
194
|
}
|
|
159
195
|
|
|
160
|
-
private string Platform
|
|
161
|
-
|
|
196
|
+
private string Platform
|
|
197
|
+
{
|
|
198
|
+
get
|
|
199
|
+
{
|
|
162
200
|
if (Application.platform == RuntimePlatform.Android)
|
|
163
201
|
{
|
|
164
202
|
return "Android";
|
|
@@ -176,11 +214,13 @@ namespace XD.SDK.Account.Internal.Standalone {
|
|
|
176
214
|
|
|
177
215
|
#region UI Events
|
|
178
216
|
|
|
179
|
-
private void OnBackClicked()
|
|
217
|
+
private void OnBackClicked()
|
|
218
|
+
{
|
|
180
219
|
OnCallback(BACK_CODE, null);
|
|
181
220
|
}
|
|
182
221
|
|
|
183
|
-
private void OnCloseClicked()
|
|
222
|
+
private void OnCloseClicked()
|
|
223
|
+
{
|
|
184
224
|
OnCallback(CLOSE_CODE, null);
|
|
185
225
|
}
|
|
186
226
|
|
|
@@ -227,7 +227,7 @@ namespace XD.SDK.Account.Standalone
|
|
|
227
227
|
}
|
|
228
228
|
catch (Exception e)
|
|
229
229
|
{
|
|
230
|
-
XDGLogger.Warn($"列表请求失败: {e}");
|
|
230
|
+
XDGLogger.Warn($"列表请求失败: {e}", XDGLoggerTag.Account);
|
|
231
231
|
errorView.SetActive(true);
|
|
232
232
|
}
|
|
233
233
|
finally
|
|
@@ -238,7 +238,7 @@ namespace XD.SDK.Account.Standalone
|
|
|
238
238
|
|
|
239
239
|
private async void Bind(LoginType loginType, int cellIndex)
|
|
240
240
|
{
|
|
241
|
-
XDGLogger.Debug("
|
|
241
|
+
XDGLogger.Debug("绑定:" + loginType, XDGLoggerTag.Account);
|
|
242
242
|
try
|
|
243
243
|
{
|
|
244
244
|
await UserModule.Bind(loginType);
|
|
@@ -254,11 +254,11 @@ namespace XD.SDK.Account.Standalone
|
|
|
254
254
|
}
|
|
255
255
|
catch (TaskCanceledException)
|
|
256
256
|
{
|
|
257
|
-
XDGLogger.Debug("关闭绑定");
|
|
257
|
+
XDGLogger.Debug("关闭绑定", XDGLoggerTag.Account);
|
|
258
258
|
}
|
|
259
259
|
catch (Exception e)
|
|
260
260
|
{
|
|
261
|
-
XDGLogger.Warn($"绑定失败: {e}");
|
|
261
|
+
XDGLogger.Warn($"绑定失败: {e}", XDGLoggerTag.Account);
|
|
262
262
|
UIManager.ShowToast(localizableString.BindError);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -289,7 +289,7 @@ namespace XD.SDK.Account.Standalone
|
|
|
289
289
|
|
|
290
290
|
private async void Unbind(LoginType loginType, int cellIndex)
|
|
291
291
|
{
|
|
292
|
-
XDGLogger.Debug("解绑: " + loginType);
|
|
292
|
+
XDGLogger.Debug("解绑: " + loginType, XDGLoggerTag.Account);
|
|
293
293
|
UIManager.ShowLoading();
|
|
294
294
|
try
|
|
295
295
|
{
|
|
@@ -313,7 +313,7 @@ namespace XD.SDK.Account.Standalone
|
|
|
313
313
|
}
|
|
314
314
|
catch (XDGError e)
|
|
315
315
|
{
|
|
316
|
-
XDGLogger.Warn(e.ToString());
|
|
316
|
+
XDGLogger.Warn(e.ToString(), XDGLoggerTag.Account);
|
|
317
317
|
if (string.IsNullOrEmpty(e.Message))
|
|
318
318
|
{
|
|
319
319
|
UIManager.ShowToast(localizableString.UnbindError);
|
|
@@ -325,11 +325,11 @@ namespace XD.SDK.Account.Standalone
|
|
|
325
325
|
}
|
|
326
326
|
catch (TaskCanceledException)
|
|
327
327
|
{
|
|
328
|
-
XDGLogger.Debug("关闭解绑");
|
|
328
|
+
XDGLogger.Debug("关闭解绑", XDGLoggerTag.Account);
|
|
329
329
|
}
|
|
330
330
|
catch (Exception e)
|
|
331
331
|
{
|
|
332
|
-
XDGLogger.Warn($"解绑失败: {e}");
|
|
332
|
+
XDGLogger.Warn($"解绑失败: {e}", XDGLoggerTag.Account);
|
|
333
333
|
UIManager.ShowToast(localizableString.UnbindError);
|
|
334
334
|
}
|
|
335
335
|
finally
|
|
@@ -370,7 +370,7 @@ namespace XD.SDK.Account.Standalone
|
|
|
370
370
|
|
|
371
371
|
public void ErrorViewTap()
|
|
372
372
|
{
|
|
373
|
-
XDGLogger.Debug("点击了 errorViewTap");
|
|
373
|
+
XDGLogger.Debug("点击了 errorViewTap", XDGLoggerTag.Account);
|
|
374
374
|
errorView.SetActive(false);
|
|
375
375
|
_ = RequestBinds();
|
|
376
376
|
}
|
|
@@ -71,7 +71,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
71
71
|
}
|
|
72
72
|
catch (Exception e)
|
|
73
73
|
{
|
|
74
|
-
XDGLogger.
|
|
74
|
+
XDGLogger.Error(e, XDGLoggerTag.Account);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -123,7 +123,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
123
123
|
{
|
|
124
124
|
if (XDGCommonInternal.IsCn())
|
|
125
125
|
{
|
|
126
|
-
XDGLogger.Warn("暂不支持的登录方式");
|
|
126
|
+
XDGLogger.Warn("暂不支持的登录方式", XDGLoggerTag.Account);
|
|
127
127
|
throw new XDGError(ResponseCode.Common.UnavailableService, "暂不支持的登录方式");
|
|
128
128
|
}
|
|
129
129
|
else
|
|
@@ -157,7 +157,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
157
157
|
{
|
|
158
158
|
if (XDGCommonInternal.IsCn())
|
|
159
159
|
{
|
|
160
|
-
XDGLogger.Warn("
|
|
160
|
+
XDGLogger.Warn($"暂不支持的登录方式:{LoginType.Email}", XDGLoggerTag.Account);
|
|
161
161
|
throw new XDGError(ResponseCode.Common.UnavailableService, "暂不支持的登录方式");
|
|
162
162
|
}
|
|
163
163
|
else
|
|
@@ -177,7 +177,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
177
177
|
{
|
|
178
178
|
if (XDGCommonInternal.IsCn() && loginType == LoginType.Email)
|
|
179
179
|
{
|
|
180
|
-
XDGLogger.Warn("
|
|
180
|
+
XDGLogger.Warn($"暂不支持的登录方式:{LoginType.Email}", XDGLoggerTag.Account);
|
|
181
181
|
throw new XDGError(ResponseCode.Common.UnavailableService, "暂不支持的登录方式");
|
|
182
182
|
}
|
|
183
183
|
|
|
@@ -192,7 +192,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
192
192
|
{
|
|
193
193
|
if (localUser == null)
|
|
194
194
|
{
|
|
195
|
-
XDGLogger.Warn("
|
|
195
|
+
XDGLogger.Warn("自动登录缺少本地登录信息", XDGLoggerTag.Account);
|
|
196
196
|
if (ConfigModule.UsingTapPC && !ConfigModule.DisableAutoLogin2Tap)
|
|
197
197
|
{
|
|
198
198
|
return await Login(LoginType.TapTap);
|
|
@@ -209,13 +209,13 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
209
209
|
|
|
210
210
|
if (token == null || !token.ContainsKey("token"))
|
|
211
211
|
{
|
|
212
|
-
XDGLogger.Warn("Third token expired.");
|
|
212
|
+
XDGLogger.Warn("Third token expired.", XDGLoggerTag.Account);
|
|
213
213
|
throw new XDGError(ResponseCode.Account.TokenExpired, "Third token expired.");
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
catch (Exception e)
|
|
217
217
|
{
|
|
218
|
-
XDGLogger.Warn(e.Message);
|
|
218
|
+
XDGLogger.Warn(e.Message, XDGLoggerTag.Account);
|
|
219
219
|
throw new XDGError(ResponseCode.Common.Failed, e.Message);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
@@ -233,7 +233,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
233
233
|
}
|
|
234
234
|
catch (Exception e)
|
|
235
235
|
{
|
|
236
|
-
XDGLogger.Warn(e.Message);
|
|
236
|
+
XDGLogger.Warn(e.Message, XDGLoggerTag.Account);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
_ = AccessTokenModule.Refresh();
|
|
@@ -283,10 +283,10 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
283
283
|
}
|
|
284
284
|
catch (Exception e)
|
|
285
285
|
{
|
|
286
|
-
XDGLogger.Warn(e.ToString());
|
|
286
|
+
XDGLogger.Warn(e.ToString(), XDGLoggerTag.Account);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
XDGLogger.Debug(string.Format($"xd userID: {user.UserId}"));
|
|
289
|
+
XDGLogger.Debug(string.Format($"xd userID: {user.UserId}"), XDGLoggerTag.Account);
|
|
290
290
|
return user;
|
|
291
291
|
}
|
|
292
292
|
catch (XDGError e)
|
|
@@ -366,7 +366,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
366
366
|
XDGAccessToken localToken = await AccessTokenModule.GetLocalAccessToken();
|
|
367
367
|
string steamId = SteamAuth.GetSteamIdFromSDK();
|
|
368
368
|
XDGUser user;
|
|
369
|
-
XDGLogger.Debug($"LoginByConsole steamId: {steamId} localToken: {localToken} steamId: {steamId}");
|
|
369
|
+
XDGLogger.Debug($"LoginByConsole steamId: {steamId} localToken: {localToken} steamId: {steamId}", XDGLoggerTag.Account);
|
|
370
370
|
if (!string.IsNullOrEmpty(localToken?.SteamId) && !string.IsNullOrEmpty(steamId) && localToken?.SteamId == steamId)
|
|
371
371
|
{
|
|
372
372
|
try
|
|
@@ -401,10 +401,10 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
401
401
|
}
|
|
402
402
|
catch (Exception e)
|
|
403
403
|
{
|
|
404
|
-
XDGLogger.Warn(e.ToString());
|
|
404
|
+
XDGLogger.Warn(e.ToString(), XDGLoggerTag.Account);
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
XDGLogger.Debug(string.Format($"xd userID: {user.UserId}"));
|
|
407
|
+
XDGLogger.Debug(string.Format($"xd userID: {user.UserId}"), XDGLoggerTag.Account);
|
|
408
408
|
return user;
|
|
409
409
|
}
|
|
410
410
|
finally
|
|
@@ -17,7 +17,7 @@ namespace XD.SDK.Account.Internal.Standalone
|
|
|
17
17
|
|
|
18
18
|
public async void Handler(IBridgeWebView webView, string data, Action<object> callbackFunction)
|
|
19
19
|
{
|
|
20
|
-
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}");
|
|
20
|
+
XDGLogger.Debug($"message from javascript by:{GetName()} with data:{data}", XDGLoggerTag.Web);
|
|
21
21
|
var token = await AccessTokenModule.GetLocalAccessToken();
|
|
22
22
|
if (token == null)
|
|
23
23
|
{
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.xd.sdk.account",
|
|
3
3
|
"displayName": "XDGSDK Account",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.2",
|
|
5
5
|
"description": "XDGSDK",
|
|
6
6
|
"unity": "2019.3",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"com.xd.sdk.common": "7.1.
|
|
9
|
+
"com.xd.sdk.common": "7.1.2"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
/package/Plugins/Android/libs/{XDGBridgeAccount_v7_7.1.0.aar → XDGBridgeAccount_v7_7.1.2.aar}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|