Beispiel #1
0
        public bool CreateRole(UserToken token, string name)
        {
            //账号是否登录 获取账号ID
            int accountID = accountBiz.Get(token);

            if (accountID == -1)
            {
                return(false);
            }
            //判断当前是否已经拥有角色
            if (userCache.HasByAccountId(accountID))
            {
                return(false);
            }

            userCache.CreateRole(token, name, accountID);
            return(true);
        }