| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- public class LoginTest : MonoBehaviour
- {
- // Start is called before the first frame update
- void Start()
- {
-
- }
- // Update is called once per frame
- void Update()
- {
- if (Input.GetKeyDown(KeyCode.Q))
- {
- Login("lvjincheng", "19980301");
- }
- }
- private void Login(string user, string password)
- {
- StartCoroutine(LoginController.Instance.LoginNormal(
- user, password, (res) => {
- PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey(res.msg));
- if (res.code == 0)
- {
- string loginToken = (string)res.data;
- GoToHome(loginToken);
- }
- }
- ));
- }
- private void GoToHome(string loginToken)
- {
- CommonConfig.businessServerWsURL = loginToken.Split('&')[2];
- PlayerPrefs.SetString(LoginMgr.LoginTokenKey, loginToken);
- SceneManager.LoadScene("Home", LoadSceneMode.Single);
- }
- }
|