Exemple #1
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
        public IActionResult RegisterPassword([FromBody] Dregister my)
        {
            string phone            = my.Phone;
            string password         = my.Password;
            string password_confirm = my.Passwordconfirm;

            try
            {
                string temp = "";
                if (phone.Length != 11)
                {
                    temp = "请输入11位手机号";
                }
                else if (!password.Equals(password_confirm))
                {
                    temp = "前后密码不一致";
                }
                else
                {
                    _loginService.SignUpPhone(new UserInfo {
                        Phone = my.Phone, Password = my.Password
                    });
                    temp = "success";
                }
                return(Json(new { Message = temp }));
            }
            catch (PhoneAlreadyExistsException)
            {
                return(StatusCode(409, new { msg = "手机已注册" }));
            }
        }
Exemple #2
0
        public IActionResult Register([FromBody] Dregister my)
        {
            string phone            = my.Phone;
            string password         = my.Password;
            string password_confirm = my.Passwordconfirm;

            string temp = "";

            //if (!password.Equals(password_confirm))
            //    temp = "前后密码不一致";
            if (phone.Length != 11)
            {
                temp = "手机号格式不正确";
            }
            else if (!password.Equals(password_confirm))
            {
                temp = "前后密码不一致";
            }
            else
            {
                temp = "success";
            }
            return(Json(new { Message = temp }));
        }