Skip to content

Commit

Permalink
6.15
Browse files Browse the repository at this point in the history
  • Loading branch information
starlying committed May 28, 2020
1 parent 11e9f4c commit bbf5a16
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
19 changes: 16 additions & 3 deletions SiteServer.CMS/Model/ContentInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,23 @@ public override Dictionary<string, object> ToDictionary()
value = PageUtility.ParseNavigationUrl(siteInfo, value, false);
}

dict.Remove(styleInfo.AttributeName);
dict[styleInfo.AttributeName] = value;

var extendAttributeName = ContentAttribute.GetExtendAttributeName(styleInfo.AttributeName);
dict.Remove(extendAttributeName);

var extendValues = GetString(extendAttributeName);
dict[$"{styleInfo.AttributeName}Extends"] = 0;
if (!string.IsNullOrEmpty(extendValues))
{
var no = 0;
var extends = TranslateUtils.StringCollectionToStringList(extendValues);
foreach (var extend in extends)
{
dict[$"{styleInfo.AttributeName}Extend{++no}"] = PageUtility.ParseNavigationUrl(siteInfo, extend, false);
}
dict[$"{styleInfo.AttributeName}Extends"] = no;
}
}
else if (styleInfo.InputType == InputType.TextEditor)
{
Expand All @@ -326,12 +341,10 @@ public override Dictionary<string, object> ToDictionary()
{
value = ContentUtility.TextEditorContentDecode(siteInfo, value, false);
}
dict.Remove(styleInfo.AttributeName);
dict[styleInfo.AttributeName] = value;
}
else
{
dict.Remove(styleInfo.AttributeName);
dict[styleInfo.AttributeName] = Get(styleInfo.AttributeName);
}
}
Expand Down
2 changes: 1 addition & 1 deletion SiteServer.CMS/StlParser/StlElement/StlPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private StlPlayer() { }
public static string Parse(PageInfo pageInfo, ContextInfo contextInfo)
{
var type = BackgroundContentAttribute.VideoUrl;
var playUrl = string.Empty;
var playUrl = PlayByFlowPlayer;
var imageUrl = string.Empty;
var playBy = string.Empty;
var width = 450;
Expand Down
4 changes: 2 additions & 2 deletions SiteServer.Web/Controllers/V1/ContentsController.Dto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class QueryRequest
public class QueryResult
{
public int TotalCount { get; set; }
public IEnumerable<ContentInfo> Contents { get; set; }
public IEnumerable<Dictionary<string, object>> Contents { get; set; }
}

public class CheckRequest
Expand All @@ -68,7 +68,7 @@ public class CheckRequest

public class CheckResult
{
public List<ContentInfo> Contents { get; set; }
public List<Dictionary<string, object>> Contents { get; set; }
}
}
}
16 changes: 8 additions & 8 deletions SiteServer.Web/Controllers/V1/ContentsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public IHttpActionResult Create(int siteId, int channelId)

return Ok(new
{
Value = contentInfo
Value = contentInfo.ToDictionary()
});
}
catch (Exception ex)
Expand Down Expand Up @@ -212,7 +212,7 @@ public IHttpActionResult Update(int siteId, int channelId, int id)

return Ok(new
{
Value = contentInfo
Value = contentInfo.ToDictionary()
});
}
catch (Exception ex)
Expand Down Expand Up @@ -267,7 +267,7 @@ public IHttpActionResult Delete(int siteId, int channelId, int id)

return Ok(new
{
Value = contentInfo
Value = contentInfo.ToDictionary()
});
}
catch (Exception ex)
Expand Down Expand Up @@ -316,7 +316,7 @@ public IHttpActionResult Get(int siteId, int channelId, int id)

return Ok(new
{
Value = contentInfo
Value = contentInfo.ToDictionary()
});
}
catch (Exception ex)
Expand Down Expand Up @@ -366,11 +366,11 @@ public QueryResult GetContents([FromBody] QueryRequest request)
var totalCount = DataProvider.ContentDao.GetTotalCount(tableName, query);
var channelContentIds = DataProvider.ContentDao.GetChannelContentIdList(tableName, query);

var contents = new List<ContentInfo>();
var contents = new List<Dictionary<string, object>>();
foreach (var channelContentId in channelContentIds)
{
var content = ContentManager.GetContentInfo(site, channelContentId.ChannelId, channelContentId.Id);
contents.Add(content);
contents.Add(content.ToDictionary());
}

return new QueryResult
Expand All @@ -394,7 +394,7 @@ public CheckResult CheckContents([FromBody] CheckRequest request)
var site = SiteManager.GetSiteInfo(request.SiteId);
if (site == null) return Request.BadRequest<CheckResult>("无法确定内容对应的站点");

var contents = new List<ContentInfo>();
var contents = new List<Dictionary<string, object>>();
foreach (var channelContentId in request.Contents)
{
var channel = ChannelManager.GetChannelInfo(request.SiteId, channelContentId.ChannelId);
Expand All @@ -410,7 +410,7 @@ public CheckResult CheckContents([FromBody] CheckRequest request)

DataProvider.ContentDao.Update(site, channel, content);

contents.Add(content);
contents.Add(content.ToDictionary());

var contentCheck = new ContentCheckInfo
{
Expand Down
2 changes: 0 additions & 2 deletions SiteServer.Web/SiteServer/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ var methods = {
}).then(function (response) {
var res = response.data;

}).catch(function (error) {
utils.error($this, error);
}).then(function () {
$this.create();
});
Expand Down
2 changes: 1 addition & 1 deletion SiteServer.Web/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<add key="SecretKey" value="eef9e4b0d48bf7a5" />

<add key="DatabaseType" value="MySql" />
<add key="ConnectionString" value="Server=47.95.221.96;Uid=root;Pwd=siteservercms88;Database=web;SslMode=Preferred;CharSet=utf8" />
<add key="ConnectionString" value="" />
<!--<add key="ConnectionString" value="" />-->

<add key="Microsoft.VisualStudio.Enterprise.AspNetHelper.VsInstrLocation" value="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools\vsinstr.exe" />
Expand Down

0 comments on commit bbf5a16

Please sign in to comment.