25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using BPASmartClient.CustomResource.Pages.ViewModel;
- using BPASmartClient.Nfc;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.CustomResource.Pages.Model
- {
- public class NfcServer
- {
-
- private volatile static NfcServer _Instance;
- public static NfcServer GetInstance => _Instance ?? (_Instance = new NfcServer());
- private NfcServer() { }
- public bool EnableLogin { get; set; }
-
- public Action Update { get; set; }
- public void Init()
- {
- NFCHelper.GetInstance.Update = new Action(() =>
- {
- Update?.Invoke();
- if (!EnableLogin)
- {
- if (NFCHelper.GetInstance.GetReadResult?.CardNum.Length > 0)
- {
- string id = NFCHelper.GetInstance.GetReadResult?.CardNum;
- var res = Global.userManager.userInfos.FirstOrDefault(p => p.CardId == id) ;
- if (res != null)
- {
- BPASmartClient.Message.MessageLog.GetInstance.ShowDebugLog("NFC卡登录");
- LoginViewModel.NfcLogin(id);
- }
- }
- }
- });
-
- NFCHelper.GetInstance.Init();
- }
-
- }
- }
|