コード例 #1
0
        public async Task <GetResult> Get([FromBody] GetRequest request)
        {
            var user = await _authManager.GetUserAsync();

            var dynamicInfo = StlDynamic.GetDynamicInfo(_settingsManager, request.Value, request.Page, user, Request.Path + Request.QueryString);
            var ifInfo      = TranslateUtils.JsonDeserialize <DynamicIfInfo>(dynamicInfo.Settings);

            var isSuccess = false;
            var html      = string.Empty;

            if (ifInfo != null)
            {
                if (StringUtils.EqualsIgnoreCase(ifInfo.Type, StlIf.TypeIsUserLoggin))
                {
                    isSuccess = _authManager.IsUser;
                }

                var template = isSuccess ? dynamicInfo.YesTemplate : dynamicInfo.NoTemplate;
                html = await StlDynamic.ParseDynamicAsync(_parseManager, dynamicInfo, template);
            }

            return(new GetResult
            {
                Value = isSuccess,
                Html = html
            });
        }
コード例 #2
0
        public async Task <SubmitResult> Submit([FromBody] SubmitRequest request)
        {
            var user = await _authManager.GetUserAsync();

            var dynamicInfo = StlDynamic.GetDynamicInfo(_settingsManager, request.Value, request.Page, user, Request.Path + Request.QueryString);
            var template    = dynamicInfo.YesTemplate;

            return(new SubmitResult
            {
                Value = true,
                Html = await StlDynamic.ParseDynamicAsync(_parseManager, dynamicInfo, template)
            });
        }
コード例 #3
0
ファイル: ParseManager.cs プロジェクト: ooyuan1984/cms-1
 public async Task <string> ParseDynamicAsync(Dynamic dynamic, string template)
 {
     return(await StlDynamic.ParseDynamicAsync(this, dynamic, template));
 }