예제 #1
0
        public async Task <IActionResult> LoginJson(string userName, string password)
        {
            TData <UserLogin> userObj = await userLoginService.CheckLogin(userName, password);

            if (userObj.Tag == 1)
            {
                CookieOptions option = new CookieOptions();
                option.Expires = DateTime.Now.AddDays(30);
                HttpContext?.Response.Cookies.Append(CommonData.TokenName, userObj.Data.ToJsonString(), option);
            }

            return(Json(userObj));
        }