com.xd.sdk.account 7.0.2 → 7.1.1

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.
@@ -4,6 +4,6 @@
4
4
  //
5
5
  // Created by Fattycat on 2023/4/14.
6
6
  //
7
- #define XDGAccount_VERSION @"7.0.2"
8
- #define XDSAccount_VERSION_CODE @"7000020"
9
- // HASH ed74f1fb
7
+ #define XDGAccount_VERSION @"7.1.0"
8
+ #define XDSAccount_VERSION_CODE @"7001000"
9
+ // HASH 669fedcf
@@ -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
  {
@@ -208,7 +208,8 @@ namespace XD.SDK.Account.Internal.Standalone
208
208
 
209
209
  string scene = e.ExtraData["captcha_scene"] as string;
210
210
 
211
- async void Callback(string token, XDGError error)
211
+ AliyunTrack.TriggerCaptchaStart("login_email");
212
+ XDGCaptcha.ValidateWithCaptcha(scene, new Dictionary<string, string>() { { "eventSessionId", AliyunTrack.LoginEventSessionId } }, (async (token, error) =>
212
213
  {
213
214
  if (!string.IsNullOrEmpty(token))
214
215
  {
@@ -227,10 +228,7 @@ namespace XD.SDK.Account.Internal.Standalone
227
228
  {
228
229
  tcs.TrySetException(error as XDGError ?? throw new InvalidOperationException());
229
230
  }
230
- }
231
-
232
- AliyunTrack.TriggerCaptchaStart("login_email");
233
- XDGCaptcha.ValidateWithCaptcha(scene, new Dictionary<string, string>(){{"eventSessionId", AliyunTrack.LoginEventSessionId}}, Callback);
231
+ }));
234
232
  response = await tcs.Task;
235
233
  }
236
234
  else if (e.Code == INVALID_EMAIL_FORMAT)
@@ -307,7 +305,7 @@ namespace XD.SDK.Account.Internal.Standalone
307
305
  }
308
306
  }
309
307
 
310
- XDGCaptcha.ValidateWithCaptcha(scene, new Dictionary<string, string>(){{"eventSessionId", AliyunTrack.LoginEventSessionId}}, Callback);
308
+ XDGCaptcha.ValidateWithCaptcha(scene, new Dictionary<string, string>() { { "eventSessionId", AliyunTrack.LoginEventSessionId } }, Callback);
311
309
  response = await tcs.Task;
312
310
  }
313
311
  else
@@ -78,18 +78,7 @@ namespace XD.SDK.Account.Internal.Standalone
78
78
  }
79
79
  else
80
80
  {
81
- UIManager.ShowUI<XDWebViewAlert>("XDWebViewAlert", new Dictionary<string, object>
82
- {
83
- {
84
- "url", url
85
- }
86
- }, (code, data) =>
87
- {
88
- if (code == XDWebViewAlert.CLOSE_CODE)
89
- {
90
- UIManager.Dismiss();
91
- }
92
- });
81
+ Application.OpenURL(url);
93
82
  }
94
83
  });
95
84
  }
@@ -116,7 +105,7 @@ namespace XD.SDK.Account.Internal.Standalone
116
105
  }
117
106
 
118
107
  var response = await XDHttpClient.Client.GetAsync<SupportBaseResponse<SupportUnReadResponse>>(
119
- requestUrl,null, queryMap);
108
+ requestUrl, null, queryMap);
120
109
 
121
110
  var bHasUnRead = response.Data.HasUnread;
122
111
  var bUnReadStatusChange = bHasUnRead != Instance.bLastHasRead;
@@ -183,27 +172,35 @@ namespace XD.SDK.Account.Internal.Standalone
183
172
  XDGLogger.Debug("Support RequestSupportUrl");
184
173
  try
185
174
  {
186
- if (path == null)
175
+ path = path ?? "";
176
+ extra = extra ?? new Dictionary<string, object>();
177
+
178
+ // 构建 URL-encoded 查询串(更简洁)
179
+ string Enc(string s)
187
180
  {
188
- path = "";
181
+ return Uri.EscapeDataString(s ?? string.Empty);
189
182
  }
190
183
 
191
- if (extra == null)
184
+ var parts = new List<string>();
185
+
186
+ if (roleInfo != null)
192
187
  {
193
- extra = new Dictionary<string, object>();
188
+ if (!string.IsNullOrEmpty(roleInfo.RoleId)) parts.Add($"{Enc("role_id")}={Enc(roleInfo.RoleId)}");
189
+ if (!string.IsNullOrEmpty(roleInfo.RoleName)) parts.Add($"{Enc("role_name")}={Enc(roleInfo.RoleName)}");
190
+ if (!string.IsNullOrEmpty(roleInfo.ServerId)) parts.Add($"{Enc("server_id")}={Enc(roleInfo.ServerId)}");
194
191
  }
195
192
 
196
- if (roleInfo != null)
193
+ foreach (var kv in extra)
197
194
  {
198
- extra.Add("role_id", roleInfo.RoleId);
199
- extra.Add("role_name", roleInfo.RoleName);
200
- extra.Add("server_id", roleInfo.ServerId);
195
+ parts.Add($"{Enc(kv.Key)}={Enc(kv.Value != null ? kv.Value.ToString() : string.Empty)}");
201
196
  }
202
197
 
198
+ var urlParams = string.Join("&", parts);
199
+
203
200
  var data = new Dictionary<string, object>
204
201
  {
205
202
  { "path", path },
206
- { "urlEncodedUserParams", Uri.EscapeDataString(JsonConvert.SerializeObject(extra)) }
203
+ { "urlEncodedUserParams", urlParams }
207
204
  };
208
205
 
209
206
  var query = new Dictionary<string, object>()
@@ -271,13 +271,13 @@ namespace XD.SDK.Account.Standalone
271
271
  }
272
272
  else
273
273
  {
274
- if (string.IsNullOrEmpty(error.Message))
274
+ if (string.IsNullOrEmpty(error.ErrorMsg))
275
275
  {
276
276
  UIManager.ShowToast(localizableString.BindError);
277
277
  }
278
278
  else
279
279
  {
280
- UIManager.ShowToast(error.Message);
280
+ UIManager.ShowToast(error.ErrorMsg);
281
281
  }
282
282
  }
283
283
 
@@ -69,7 +69,7 @@ namespace XD.SDK.Account
69
69
  /// <summary>
70
70
  /// 打开用户中心
71
71
  /// </summary>
72
- public static void OpenUserCenter(XDGRoleInfo roleInfo)
72
+ public static void OpenUserCenter(XDGRoleInfo roleInfo = null)
73
73
  {
74
74
  XDGAccountInternal.OpenUserCenter();
75
75
  }
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.0.2",
4
+ "version": "7.1.1",
5
5
  "description": "XDGSDK",
6
6
  "unity": "2019.3",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "com.xd.sdk.common": "7.0.2"
9
+ "com.xd.sdk.common": "7.1.1"
10
10
  }
11
11
  }