/// <summary>
        /// 登录
        /// </summary>
        /// <param name="context"></param>
        /// <param name="sysUser"></param>
        /// <returns></returns>
        public async Task <bool> LoginAsync(HttpContext context, SysUser sysUser)
        {
            var user = await _sysUserRepository.FindUserForLoginAsync(sysUser.LoginName, sysUser.Password);

            if (user == null)
            {
                return(false);
            }
            //登录日志
            await _sysLoginLogAppService.InsertLogAsync(new SysLoginLogDto { LoginName = user.LoginName, Name = user.Name, LoginType = LoginType.Cookie });

            //颁发用户票据
            var claimIdentity   = this.CreateClaimsIdentity(user);
            var claimsPrincipal = new ClaimsPrincipal(claimIdentity);
            await context.SignInAsync(claimsPrincipal, new AuthenticationProperties()
            {
                IsPersistent = true // Fasle CookieOption.Expires不生效
                                    //IssuedUtc 颁发时间无需设置默认 CookieScheme的SingInAsync取当前时间,
                                    //ExpiresUtc 无需设置默认CookieScheme的SingInAsync 当前时间加option.ExpireTimeSpan
                                    //同时设定CookieOption.Expires为当前 票据过期时间
                                    //至此建议票据颁发时期均默认使用 option.ExpireTimeSpan设置
            });

            return(true);
        }