示例#1
0
        public async Task <IActionResult> GetUser([FromQuery] string user)
        {
            if (user == null)
            {
                return(ErrorViewModel.IsEmptyUser());
            }
            var checkUser = await GetIdentityUser(user);

            if (checkUser == null)
            {
                return(ErrorViewModel.NotFoundUser());
            }
            var resultCheck = new {
                id        = checkUser.Id,
                foundUser = checkUser.Login
            };

            return(Json(resultCheck));
        }
示例#2
0
        public async Task <IActionResult> GetUser([FromBody] UserCheckModel user)
        {
            string userNameTo = user.UserNameTo;

            if (userNameTo == "")
            {
                return(ErrorViewModel.IsEmptyUser());
            }
            var checkUser = await GetIdentityUser(userNameTo);

            if (checkUser == null)
            {
                return(ErrorViewModel.NotFoundUser());
            }
            var resultCheck = new {
                id        = checkUser.Id,
                foundUser = checkUser.Login
            };

            return(Json(resultCheck));
        }
示例#3
0
        public async Task <IActionResult> RememberPassword(string param)
        {
            User sResult;

            if (param != "")
            {
                if (param.IndexOf("@") >= 0)
                {
                    sResult = await db.Users.FirstOrDefaultAsync(p => p.Email == param);

                    return(Ok());
                }
                else
                {
                    sResult = await db.Users.FirstOrDefaultAsync(p => p.Login == param);

                    return(Ok());
                }
            }
            return(ErrorViewModel.NotFoundUser());
        }