You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Txgy.EWS.Client.Common;
|
|
using Txgy.EWS.Client.Entity;
|
|
using Txgy.EWS.Client.IBLL;
|
|
using Txgy.EWS.Client.IDAL;
|
|
|
|
namespace Txgy.EWS.Client.BLL
|
|
{
|
|
public class LoginBLL : ILoginBLL
|
|
{
|
|
IWebDataAccess _webDataAccess;
|
|
public LoginBLL(IWebDataAccess webDataAccess)
|
|
{
|
|
_webDataAccess = webDataAccess;
|
|
}
|
|
public async Task<bool> Login(string uName, string pwd)
|
|
{
|
|
// 通过DAL进行数据获取
|
|
/// 登录窗口进行用户名 密码的校验
|
|
/// 校验成功:跳转到主窗口
|
|
/// 校验失败:保持当前状态
|
|
/// 有个问题:如果跳转到主窗口,需要用户信息的显示:再取一次
|
|
var userStr = await _webDataAccess.Login(uName, pwd);
|
|
UserInfoEntity userEntity = Newtonsoft.Json.JsonConvert.DeserializeObject<UserInfoEntity>(userStr);
|
|
// 转换成全局用户信息
|
|
if (userEntity != null)
|
|
{
|
|
GlobalData.CurrentUserInfo = userEntity;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|