Exemplo n.º 1
0
        public async Task <IActionResult> InitAppManagerAsync()
        {
            var appTypes = await _appServices.GetAppTypesAsync();

            var appStyles = _appServices.GetAppStyles().ToList();
            var appStates = _appServices.GetAppStates().Where(w => w.Name == "未审核" || w.Name == "已发布").ToList();

            return(Json(new ResponseModel <dynamic>
            {
                Model = new { appTypes, appStyles, appStates },
                IsSuccess = true,
                Message = "应用管理初始化成功"
            }));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> InitUserAppManageAsync()
        {
            var appTypes = await _appServices.GetAppTypesAsync();

            var userContext = await GetUserContextAsync();

            if (!userContext.IsAdmin)
            {
                appTypes = appTypes.Where(w => !w.IsSystem).ToList();
            }

            var appStyles = _appServices.GetAppStyles().ToList();
            var appStates = _appServices.GetAppStates().ToList();
            var response  = new ResponseModel <dynamic>
            {
                Model     = new { appTypes, appStates, appStyles },
                IsSuccess = true,
                Message   = "用户应用管理初始化成功"
            };

            return(Json(response));
        }