123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class UserInfo {
- //设备sn号
- public static string Serialno = string.Empty;
- //影创账号
- public static string Account = string.Empty;
- //影创应用号
- public static string AppID = string.Empty;
- //影创Token
- public static string Token = string.Empty;
- //应用Token
- public static string User_Token = string.Empty;
- //应用uid
- public static string uid = string.Empty;
- public static SystemDatas systemDatas;
- /// <summary>
- /// 判断是否为游客账号
- /// </summary>
- /// <returns><c>true</c>, if vistor account was ised, <c>false</c> otherwise.</returns>
- public static bool isVistorAccount()
- {
- return Serialno == Account;
- }
- /// <summary>
- /// 判断用户是否登陆
- /// </summary>
- /// <returns><c>true</c>, if login was ised, <c>false</c> otherwise.</returns>
- public static bool isLogin()
- {
- return Account != string.Empty;
- }
- private string _userToken;
- private int _userTokenExpireTime;
- private int _id;
- private string _nickName;
- public string _avatar;
- public string _devideID;
- public string _phone;
- public string _email;
- private bool _isActivate;
- public string UserToken
- {
- get => _userToken;
- }
- public int UserTokenExpireTime
- {
- get => _userTokenExpireTime;
- }
- public int Id { get => _id;}
- public string NickName { get => _nickName; }
- public bool IsActivate { get => _isActivate; }
- public void SetTokenInfo(string token, int expireTime)
- {
- _userToken = token;
- _userTokenExpireTime = expireTime;
-
- }
- public void SetUserInfo(int id, string token = "", int expireTime = 0, string avatar = "", string nickName = "", bool isActivate=false, string phoneNum = "", string email = "", string deviceID = "")
- {
- this._id = id;
- this._avatar = avatar;
- this._nickName = nickName;
- this._phone = phoneNum;
- this._email = email;
- this._devideID = deviceID;
- this._isActivate = isActivate;
- SetTokenInfo(token, expireTime);
- }
- public void UserClear(int id, string token = "", int expireTime = 0)
- {
- SetUserInfo(id, token, expireTime);
- }
- public void SetNickNameAvatar(string avatar, string nickName)
- {
- this._avatar = avatar;
- this._nickName = nickName;
- }
- }
|