Exemplo n.º 1
0
        public async Task <IActionResult> GetModelByGuid([FromBody] ParmString parm)
        {
            var res = await _adminService.GetModelAsync(m => m.Guid == parm.parm);

            if (!string.IsNullOrEmpty(res.data.Guid))
            {
                res.data.LoginPwd = DES3Encrypt.DecryptString(res.data.LoginPwd);
            }
            return(Ok(res));
        }
Exemplo n.º 2
0
        public void OnGet()
        {
            Site = _siteService.GetModelAsync(m => m.Guid == "78756a6c-50c8-47a5-b898-5d6d24a20327").Result.data;
            var adminGuid = User.Identities.First(u => u.IsAuthenticated).FindFirst(ClaimTypes.Sid).Value;

            Admin = _adminService.GetModelAsync(m => m.Guid == adminGuid).Result.data;
        }
Exemplo n.º 3
0
        public IActionResult AdminModify(string id)
        {
            ViewBag.Roles = _sysRoleService.GetListAsync(m => m.IsEnable, m => m.Sort, DbOrderEnum.Desc).Result.data;
            var adminModel = _sysAdminService.GetModelAsync(id).Result.data;

            //密码解密
            if (adminModel != null)
            {
                adminModel.Pwd = DES3Encrypt.DecryptString(adminModel.Pwd);
            }
            return(View(adminModel));
        }
Exemplo n.º 4
0
        public async Task OnGetAsync(int id = 0)
        {
            if (id != 0)
            {
                Agent           = (await _agent.GetModelAsync(m => m.Id == id)).data;
                Agent.LoginName = (await _admin.GetModelAsync(m => m.Guid == Agent.Admin_Guid)).data.LoginName;
            }
            else
            {
                Agent = new CmsAgent();
            }

            Levels = (await _level.GetListAsync()).data;
        }
Exemplo n.º 5
0
        public IActionResult Index()
        {
            //var sysConfigVM = new SysConfigVM()
            //{
            //    Ip = _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString()
            //};
            //if (sysConfigVM.Ip.Length < 10)
            //{
            //    sysConfigVM.Ip = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList.FirstOrDefault(address => address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.ToString();
            //}

            //ViewBag.SysConfigVM = sysConfigVM;
            //ViewBag.Site = _siteService.GetModelAsync(m => m.ID == "78756a6c-50c8-47a5-b898-5d6d24a20327").Result.data;
            var adminID = User.Identities.First(u => u.IsAuthenticated).FindFirst(ClaimTypes.Sid).Value;

            ViewBag.Admin = _adminService.GetModelAsync(m => m.ID == adminID).Result.data;

            return(View(_sysMenuService.GetPagesAsync(new PageParm()
            {
                limit = 1000
            }).Result.data));
        }
Exemplo n.º 6
0
 public void OnGet(string guid)
 {
     adminModel = _adminService.GetModelAsync(m => m.Guid == guid).Result.data;
     //密码解密
     adminModel.LoginPwd = DES3Encrypt.DecryptString(adminModel.LoginPwd);
 }