示例#1
0
        public IHttpActionResult Get()
        {
            var m    = Request.GetQueryString("m");
            var p    = Request.GetQueryString("p");
            var uuid = Request.GetQueryString("u");
            var code = Request.GetQueryString("c");

            // 先检查验证码是否正确
            var service = new VerificationCodeService();
            var r       = service.AuthCode(m, uuid, code);

            if (r.HasError)
            {
                return(Ok(r));
            }

            // 创建经纪人
            var service2 = new BrokerAccountService();
            var r2       = service2.Create(m, p);

            if (r2.HasError)
            {
                return(Ok(r2));
            }

            return(Ok(r2, n => new { n.No }));
        }
示例#2
0
        public IHttpActionResult Get()
        {
            var m    = Request.GetQueryString("m");
            var p    = Request.GetQueryString("p");
            var uuid = Request.GetQueryString("u");
            var code = Request.GetQueryString("c");

            // 先检查验证码是否正确
            var service = new VerificationCodeService();
            var r       = service.AuthCode(m, uuid, code);

            if (r.HasError)
            {
                return(Ok(r));
            }

            // 更新密码
            var service2 = new AccountService();
            var r2       = service2.UpdatePassword(m, p);

            return(Ok(r2));
        }