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 }); } }
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 }); } }
public object ActiveCodeState(string activeCode) { try { var re = UserServer.ActiveCodeState(activeCode); return(new { msg = re }); } catch (Exception e) { return(new { msg = e.Message }); } }
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 }); } }
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 }); } }