Esempio n. 1
0
        public Task <IResultModel> Install()
        {
            var model = new SystemInstallModel
            {
                Permissions = _permissionHelper.GetAllPermission()
            };

            return(_systemService.Install(model));
        }
Esempio n. 2
0
        public async Task <IResultModel> Install(SystemInstallModel model)
        {
            await _moduleInfoService.Sync();

            await _permissionService.Sync(model.Permissions);

            var role = new RoleEntity
            {
                Name = "系统管理员"
            };

            await _roleRepository.AddAsync(role);

            var account = new AccountEntity
            {
                UserName = "******",
                Password = "******",
                Name     = "管理员"
            };
            await _accountRepository.AddAsync(account);

            await _accountRoleRepository.AddAsync(new AccountRoleEntity { AccountId = account.Id, RoleId = role.Id });

            UpdateConfig(new SystemConfigModel
            {
                Title    = "腾迪权限管理系统",
                Auditing = false,
                Toolbar  = new SystemToolbar
                {
                    Fullscreen = true,
                    Skin       = true,
                    Logout     = true,
                    UserInfo   = true
                }
            });

            return(ResultModel.Success());
        }
Esempio n. 3
0
        public async Task <IResultModel> Install(SystemInstallModel model)
        {
            //await _moduleInfoService.Sync();
            //await _permissionService.Sync(model.Permissions);

            //var role = new RoleEntity
            //{
            //    Name = "系统管理员"
            //};

            //await _roleRepository.AddAsync(role);

            //var account = new AccountEntity
            //{
            //    UserName = "******",
            //    Password = "******",
            //    Name = "管理员"
            //};
            //await _accountRepository.AddAsync(account);

            //await _accountRoleRepository.AddAsync(new AccountRoleEntity { AccountId = account.Id, RoleId = role.Id });

            //UpdateConfig(new SystemConfigModel
            //{
            //    Title = "云呼权限管理系统",
            //    Auditing = false,
            //    Toolbar = new SystemToolbar
            //    {
            //        Fullscreen = true,
            //        Skin = true,
            //        Logout = true,
            //        UserInfo = true
            //    }
            //});

            return(ResultModel.Success());
        }
Esempio n. 4
0
        public async Task <IResultModel> Install(SystemInstallModel model)
        {
            await _moduleInfoService.Sync();

            await _permissionService.Sync(model.Permissions);

            var role = new Role
            {
                Name = "系统管理员"
            };

            await _roleRepository.AddAsync(role);

            await _accountService.Add(new AccountAddModel
            {
                UserName = "******",
                Password = "******",
                Name     = "管理员",
                Roles    = new List <Guid> {
                    role.Id
                }
            });

            UpdateConfig(new SystemConfigModel
            {
                Title    = "通用权限管理系统",
                Auditing = false,
                Toolbar  = new SystemToolbar
                {
                    Fullscreen = true,
                    Skin       = true
                }
            });

            return(ResultModel.Success());
        }