Beispiel #1
0
        public object Register(string active, string account, string password, string phoneNum)
        {
            try
            {
                var addr = Server.GetUserIp(Request.HttpContext);
                if (Server.IPHandle(addr) == 0)
                {
                    return(new { msg = "your ip can't using our api , please contact administrator" });
                }
                if (UserServer.AccountIsExist(account).Equals("account is exists"))
                {
                    return(new { msg = "account is exists" });
                }

                if (UserServer.ActiveCodeState(active).Equals("key is invalid") ||
                    UserServer.ActiveCodeState(active).Equals("key is not found"))
                {
                    return(new { msg = "key is not found or invaild" });
                }

                var re = UserServer.Register(active, account, password, phoneNum);

                return(new { msg = re });
            }
            catch (Exception e)
            {
                return(new { msg = e.Message });
            }
        }
Beispiel #2
0
        public object Register([FromBody] User user)
        {
            try
            {
                if (user == null)
                {
                    return(new { msg = "bad request" });
                }

                var account  = user.Account;
                var active   = user.ActiveCode;
                var password = user.Password;
                var phoneNum = user.PhoneNum;

                if (UserServer.AccountIsExist(account).Equals("account is exists"))
                {
                    return(new { msg = "account is exists" });
                }

                if (UserServer.ActiveCodeState(active).Equals("key is invalid") ||
                    UserServer.ActiveCodeState(active).Equals("key is not found"))
                {
                    return(new { msg = "key is not found or invaild" });
                }

                var re = UserServer.Register(active, account, password, phoneNum);

                return(new { msg = re });
            }
            catch (Exception e)
            {
                return(new { msg = e.Message });
            }
        }
Beispiel #3
0
 public object ActiveCodeState(string activeCode)
 {
     try
     {
         var re = UserServer.ActiveCodeState(activeCode);
         return(new { msg = re });
     }
     catch (Exception e)
     {
         return(new { msg = e.Message });
     }
 }
Beispiel #4
0
 public object ActiveCodeState(string activeCode)
 {
     try
     {
         var addr = Server.GetUserIp(Request.HttpContext);
         if (Server.IPHandle(addr) == 0)
         {
             return(new { msg = "your ip can't using our api , please contact administrator" });
         }
         var re = UserServer.ActiveCodeState(activeCode);
         return(new { msg = re });
     }
     catch (Exception e)
     {
         return(new { msg = e.Message });
     }
 }
Beispiel #5
0
        public object Register(string active, string account, string password, string phoneNum)
        {
            try
            {
                if (UserServer.AccountIsExist(account).Equals("account is exists"))
                {
                    return(new { msg = "account is exists" });
                }

                if (UserServer.ActiveCodeState(active).Equals("key is invalid") ||
                    UserServer.ActiveCodeState(active).Equals("key is not found"))
                {
                    return(new { msg = "key is not found or invaild" });
                }

                var re = UserServer.Register(active, account, password, phoneNum);

                return(new { msg = re });
            }
            catch (Exception e)
            {
                return(new { msg = e.Message });
            }
        }