예제 #1
0
        public object DeleteUser(int id)
        {
            try
            {
                var addr = Server.GetUserIp(Request.HttpContext);
                if (Server.IpHandle(addr) == 0)
                {
                    return(new[] { "your ip can't using our api , please contact administrator" });
                }

                var account = HttpContext.Session.GetString("user_account");

                if (account == null)
                {
                    return(new
                    {
                        result = 401,
                        msg = "not login"
                    });
                }

                var re = UserServer.DeleteUser(id);

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