示例#1
0
        public async Task <JsonResult> Logout()
        {
            await signInManager.SignOutAsync();

            logger.LogDebug("用户登出");
            return(Json(ResultUtilities.Success()));
        }
示例#2
0
        public async Task <JsonResult> Login(User user)
        {
            var result = await signInManager.PasswordSignInAsync(user.Username, user.Password, false, false);

            if (result.Succeeded)
            {
                logger.LogDebug("登陆的用户为:{}", user.Username);
                return(Json(ResultUtilities.Success()));
            }
            else
            {
                logger.LogDebug("用户 {},{} 登陆失败", user.Username, user.Password);
                return(Json(result));
            }
        }