소스 검색

bug修复

master
LuanShi 2 달 전
부모
커밋
952315fdf0
4개의 변경된 파일48개의 추가작업 그리고 15개의 파일을 삭제
  1. +0
    -4
      Assets/Plugins/SDK/NativeBridgeUtil.cs
  2. +32
    -9
      Assets/Scripts/LoginAndPay/LoginView.cs
  3. +14
    -0
      Assets/Scripts/LoginAndPay/http/LoginRequest.cs
  4. +2
    -2
      ProjectSettings/ProjectSettings.asset

+ 0
- 4
Assets/Plugins/SDK/NativeBridgeUtil.cs 파일 보기

@@ -1,11 +1,7 @@
using UnityEngine;
using System.Collections;
using ETHotfix.com.commsdk.unity3d;
using System.Text.RegularExpressions;
using System;
using System.Collections.Generic;
using ETModel;
using ETModel.com.commsdk.unity3d;


+ 32
- 9
Assets/Scripts/LoginAndPay/LoginView.cs 파일 보기

@@ -34,7 +34,7 @@ public class LoginView : MonoBehaviour
string cachedPhoneNumber = PlayerPrefs.GetString("CachedPhoneNumber", "");
string cachedWxUnionId = PlayerPrefs.GetString("CachedWxUnionId", "");
if (!string.IsNullOrEmpty(cachedPhoneNumber) || !string.IsNullOrEmpty(cachedWxUnionId))
if (!string.IsNullOrEmpty(cachedPhoneNumber) && !string.IsNullOrEmpty(cachedWxUnionId))
{
HttpManager.Instance.phoneNum = cachedPhoneNumber;
HttpManager.Instance.wxUnionID = cachedWxUnionId;
@@ -128,22 +128,45 @@ public class LoginView : MonoBehaviour
}
}
async UniTask WxAndPhoneLoginTask()
{
string phonenum = PhoneNumberInputField.text;
WxAndPhoneLoginResponse wxAndPhoneLoginResponse = await HttpManager.Instance.RequestPost<WxAndPhoneLoginRequest, WxAndPhoneLoginResponse>("wx-login", new WxAndPhoneLoginRequest() { uinid = HttpManager.Instance.wxUnionID, iphone_num = HttpManager.Instance.phoneNum });
if (wxAndPhoneLoginResponse.code == 0)
{
SceneManager.LoadScene("LoadingScreen");
}
else
{
PlayerPrefs.DeleteKey("CachedPhoneNumber");
PlayerPrefs.DeleteKey("CachedWxUnionId");
PlayerPrefs.Save();
HttpManager.Instance.wxUnionID = "";
HttpManager.Instance.phoneNum = "";
isWeChatAuthorized = false;
isPhoneAuthorized = false;
CheckAuthorized();
}
}
private void CheckAuthorized()
{
if (isWeChatAuthorized && isPhoneAuthorized)
{
SceneManager.LoadScene("LoadingScreen");
//SceneManager.LoadScene("LoadingScreen");
WxAndPhoneLoginTask().Forget();
}
else if (isWeChatAuthorized && !isPhoneAuthorized)
{
WxBindButton.gameObject.SetActive(true);
PhoneTrans.SetActive(false);
WxBindButton.gameObject.SetActive(false);
PhoneTrans.SetActive(true);
loginBthTrans.SetActive(false);
}
else if (isPhoneAuthorized && !isWeChatAuthorized)
{
WxBindButton.gameObject.SetActive(false);
PhoneTrans.SetActive(true);
WxBindButton.gameObject.SetActive(true);
PhoneTrans.SetActive(false);
loginBthTrans.SetActive(false);
}
if (!isPhoneAuthorized && !isWeChatAuthorized)
@@ -172,9 +195,9 @@ public class LoginView : MonoBehaviour
NativeBridgeUtil.Instance.WeChatLogin(1);
}
void ClickWxBindButton()
{
NativeBridgeUtil.Instance.WeChatLogin(1);
void ClickWxBindButton()
{
NativeBridgeUtil.Instance.WeChatLogin(1);
}
}

+ 14
- 0
Assets/Scripts/LoginAndPay/http/LoginRequest.cs 파일 보기

@@ -65,3 +65,17 @@ public class PaymentStatusResponse : WWWResponse
public string data;
public string message;
}

[Serializable]
public class WxAndPhoneLoginRequest : WWWRequest
{
public string uinid;
public string iphone_num;
}
[Serializable]
public class WxAndPhoneLoginResponse : WWWResponse
{
public int code;
public string message;
}

+ 2
- 2
ProjectSettings/ProjectSettings.asset 파일 보기

@@ -157,7 +157,7 @@ PlayerSettings:
buildNumber: {}
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 16
AndroidTargetSdkVersion: 0
AndroidTargetSdkVersion: 28
AndroidPreferredInstallLocation: 1
aotOptions:
stripEngineCode: 1
@@ -244,7 +244,7 @@ PlayerSettings:
AndroidTargetArchitectures: 1
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName: G:/work/unity/unity2018/ZhenShiXunYouJi3/zsmxj.keystore
AndroidKeystoreName: H:/Work/unityWork/unity2018workGit/ZhenShiXunYouJi2/zsmxj.keystore
AndroidKeyaliasName: zsmxj
AndroidBuildApkPerCpuArchitecture: 0
AndroidTVCompatibility: 0


불러오는 중...
취소
저장