public string AddRole(string loginIdentifer, string roleJSONString)
        {
            JavaScriptObject obj2 = new JavaScriptObject();

            obj2.Add("Result", false);
            obj2.Add("Message", "");
            LoginUser loginUser = GlobalAppModule.GetLoginUser(loginIdentifer);

            if (loginUser == null)
            {
                obj2["Message"] = "未登录";
                return(JavaScriptConvert.SerializeObject(obj2));
            }
            if (loginUser.LoginTimeout)
            {
                obj2["Message"] = "登录超时";
                return(JavaScriptConvert.SerializeObject(obj2));
            }
            loginUser.LastOperateTime = DateTime.Now;

            try
            {
                JavaScriptObject obj3 = (JavaScriptObject)JavaScriptConvert.DeserializeObject(roleJSONString);
                if (obj3 == null)
                {
                    obj2["Message"] = "参数格式错误";
                    return(JavaScriptConvert.SerializeObject(obj2));
                }
                if (RoleModule.GetRoleId(obj3["角色名"].ToString()) > 0)
                {
                    obj2["Message"] = "此角色已经存在!";
                    return(JavaScriptConvert.SerializeObject(obj2));
                }
                try
                {
                    Role role = new Role();
                    role.RoleName = obj3["角色名"].ToString();
                    role.IsAllow  = 1;
                    role.Weight   = 1;

                    string str = "添加失败";
                    if (RoleModule.AddRole(role) > 0)
                    {
                        str            = "添加成功";
                        obj2["Result"] = true;
                    }
                    obj2["Message"] = str;
                }
                catch (Exception exception)
                {
                    obj2["Message"] = exception.Message;
                }
            }
            catch (Exception exception2)
            {
                obj2["Message"] = exception2.Message;
            }
            try
            {
                SysLog log = new SysLog();
                log.LogUserId   = loginUser.UserId;
                log.LogUserName = loginUser.LoginName;
                log.LogAddress  = ToolsWeb.GetIP(context.Request);
                log.LogTime     = DateTime.Now;
                log.LogType     = "添加角色";
                log.LogContent  = obj2["Message"].ToString() + "|" + roleJSONString;
                SysLogModule.Add(log);
            }
            catch { }
            return(JavaScriptConvert.SerializeObject(obj2));
        }