Exemplo n.º 1
0
        public IHttpActionResult GetUserRoleData()
        {
            var urp   = new UrpOper().GetList();
            var plist = new PermissionOper().GetList();

            return(Ok(new { urp, plist }));
        }
Exemplo n.º 2
0
        public static object ReturnUser(User _user)
        {
            bool enableLimtView = Config.GetSampleConfig().EnableLimtView;

            _user.Ticket = DESEncrypt.Encrypt((_user.UserName + DateTime.Now.ToLongTimeString()).GetHashCode().ToString());
            bool allSampleCanLend = Config.GetSampleConfig().AllSampleCanLend;
            var  plist            = new UrpOper().GetPermissionsKeys(_user.DdId);
            var  setting          = new { enableLimtView, allSampleCanLend };

            return(new { _user.UserName, _user.Avatar, LoginCookie = DESEncrypt.Encrypt(_user.LoginStr, "998013"), _user.LoginOverTime, _user.Ticket, _user.Role, setting, plist });
        }