|
@@ -6,6 +6,7 @@ using UnityEngine.SceneManagement;
|
|
|
using System.Text.RegularExpressions;
|
|
using System.Text.RegularExpressions;
|
|
|
using Newtonsoft.Json.Linq;
|
|
using Newtonsoft.Json.Linq;
|
|
|
using JCUnityLib;
|
|
using JCUnityLib;
|
|
|
|
|
+using AdaptUI;
|
|
|
/* 登录界面 */
|
|
/* 登录界面 */
|
|
|
public class LoginView : MonoBehaviour
|
|
public class LoginView : MonoBehaviour
|
|
|
{
|
|
{
|
|
@@ -57,6 +58,22 @@ public class LoginView : MonoBehaviour
|
|
|
//设置微信登录状态按钮
|
|
//设置微信登录状态按钮
|
|
|
transform.Find("Input Contain/otherLogin/BtnWxLogin").gameObject.SetActive(CommonConfig.AppArea == 0 && WeChatLoginHelper.IsWechatInstalled());
|
|
transform.Find("Input Contain/otherLogin/BtnWxLogin").gameObject.SetActive(CommonConfig.AppArea == 0 && WeChatLoginHelper.IsWechatInstalled());
|
|
|
|
|
|
|
|
|
|
+ //这里初始化时候,分别配置当前的微信AppID和UniversalLink
|
|
|
|
|
+ if (WeChatLoginHelper.IsWechatInstalled())
|
|
|
|
|
+ {
|
|
|
|
|
+ string applicationIdentifier = Application.identifier; // 真机下这样更稳定
|
|
|
|
|
+ if (applicationIdentifier.Contains("PadBowArrow"))
|
|
|
|
|
+ {
|
|
|
|
|
+ // iPad版
|
|
|
|
|
+ WeChatLoginHelper.InitWeChat("wx64d1835dbd218aec", "https://xmjssvr.cn/PadBowArrow/");
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ // 默认普通版
|
|
|
|
|
+ WeChatLoginHelper.InitWeChat("wxfe29f3f64e3c5d16", "https://xmjssvr.cn/BowArrow/");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void OnDestroy() {
|
|
void OnDestroy() {
|
|
@@ -219,8 +236,9 @@ public class LoginView : MonoBehaviour
|
|
|
private string _loginToken = null;
|
|
private string _loginToken = null;
|
|
|
public void OnWxLoginResp(string loginCode) {
|
|
public void OnWxLoginResp(string loginCode) {
|
|
|
if (string.IsNullOrWhiteSpace(loginCode)) return;
|
|
if (string.IsNullOrWhiteSpace(loginCode)) return;
|
|
|
|
|
+ string currentAppID = WeChatLoginHelper.CurrentAppID;
|
|
|
transform.Find("MaskWxLogin").gameObject.SetActive(true);
|
|
transform.Find("MaskWxLogin").gameObject.SetActive(true);
|
|
|
- StartCoroutine(LoginController.Instance.LoginByWX(loginCode, (res) => {
|
|
|
|
|
|
|
+ StartCoroutine(LoginController.Instance.LoginByWX_WithAppID(loginCode, currentAppID, (res) => {
|
|
|
Debug.Log($"wxlogin service rescode {res.code}, msg {res.msg}");
|
|
Debug.Log($"wxlogin service rescode {res.code}, msg {res.msg}");
|
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
|
JObject data = (JObject)res.data;
|
|
JObject data = (JObject)res.data;
|