Skip to content

Commit bbf5a16

Browse files
committed
6.15
1 parent 11e9f4c commit bbf5a16

File tree

6 files changed

+28
-17
lines changed

6 files changed

+28
-17
lines changed

SiteServer.CMS/Model/ContentInfo.cs

+16-3
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,23 @@ public override Dictionary<string, object> ToDictionary()
316316
value = PageUtility.ParseNavigationUrl(siteInfo, value, false);
317317
}
318318

319-
dict.Remove(styleInfo.AttributeName);
320319
dict[styleInfo.AttributeName] = value;
320+
321+
var extendAttributeName = ContentAttribute.GetExtendAttributeName(styleInfo.AttributeName);
322+
dict.Remove(extendAttributeName);
323+
324+
var extendValues = GetString(extendAttributeName);
325+
dict[$"{styleInfo.AttributeName}Extends"] = 0;
326+
if (!string.IsNullOrEmpty(extendValues))
327+
{
328+
var no = 0;
329+
var extends = TranslateUtils.StringCollectionToStringList(extendValues);
330+
foreach (var extend in extends)
331+
{
332+
dict[$"{styleInfo.AttributeName}Extend{++no}"] = PageUtility.ParseNavigationUrl(siteInfo, extend, false);
333+
}
334+
dict[$"{styleInfo.AttributeName}Extends"] = no;
335+
}
321336
}
322337
else if (styleInfo.InputType == InputType.TextEditor)
323338
{
@@ -326,12 +341,10 @@ public override Dictionary<string, object> ToDictionary()
326341
{
327342
value = ContentUtility.TextEditorContentDecode(siteInfo, value, false);
328343
}
329-
dict.Remove(styleInfo.AttributeName);
330344
dict[styleInfo.AttributeName] = value;
331345
}
332346
else
333347
{
334-
dict.Remove(styleInfo.AttributeName);
335348
dict[styleInfo.AttributeName] = Get(styleInfo.AttributeName);
336349
}
337350
}

SiteServer.CMS/StlParser/StlElement/StlPlayer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private StlPlayer() { }
5353
public static string Parse(PageInfo pageInfo, ContextInfo contextInfo)
5454
{
5555
var type = BackgroundContentAttribute.VideoUrl;
56-
var playUrl = string.Empty;
56+
var playUrl = PlayByFlowPlayer;
5757
var imageUrl = string.Empty;
5858
var playBy = string.Empty;
5959
var width = 450;

SiteServer.Web/Controllers/V1/ContentsController.Dto.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class QueryRequest
5656
public class QueryResult
5757
{
5858
public int TotalCount { get; set; }
59-
public IEnumerable<ContentInfo> Contents { get; set; }
59+
public IEnumerable<Dictionary<string, object>> Contents { get; set; }
6060
}
6161

6262
public class CheckRequest
@@ -68,7 +68,7 @@ public class CheckRequest
6868

6969
public class CheckResult
7070
{
71-
public List<ContentInfo> Contents { get; set; }
71+
public List<Dictionary<string, object>> Contents { get; set; }
7272
}
7373
}
7474
}

SiteServer.Web/Controllers/V1/ContentsController.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public IHttpActionResult Create(int siteId, int channelId)
117117

118118
return Ok(new
119119
{
120-
Value = contentInfo
120+
Value = contentInfo.ToDictionary()
121121
});
122122
}
123123
catch (Exception ex)
@@ -212,7 +212,7 @@ public IHttpActionResult Update(int siteId, int channelId, int id)
212212

213213
return Ok(new
214214
{
215-
Value = contentInfo
215+
Value = contentInfo.ToDictionary()
216216
});
217217
}
218218
catch (Exception ex)
@@ -267,7 +267,7 @@ public IHttpActionResult Delete(int siteId, int channelId, int id)
267267

268268
return Ok(new
269269
{
270-
Value = contentInfo
270+
Value = contentInfo.ToDictionary()
271271
});
272272
}
273273
catch (Exception ex)
@@ -316,7 +316,7 @@ public IHttpActionResult Get(int siteId, int channelId, int id)
316316

317317
return Ok(new
318318
{
319-
Value = contentInfo
319+
Value = contentInfo.ToDictionary()
320320
});
321321
}
322322
catch (Exception ex)
@@ -366,11 +366,11 @@ public QueryResult GetContents([FromBody] QueryRequest request)
366366
var totalCount = DataProvider.ContentDao.GetTotalCount(tableName, query);
367367
var channelContentIds = DataProvider.ContentDao.GetChannelContentIdList(tableName, query);
368368

369-
var contents = new List<ContentInfo>();
369+
var contents = new List<Dictionary<string, object>>();
370370
foreach (var channelContentId in channelContentIds)
371371
{
372372
var content = ContentManager.GetContentInfo(site, channelContentId.ChannelId, channelContentId.Id);
373-
contents.Add(content);
373+
contents.Add(content.ToDictionary());
374374
}
375375

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

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

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

413-
contents.Add(content);
413+
contents.Add(content.ToDictionary());
414414

415415
var contentCheck = new ContentCheckInfo
416416
{

SiteServer.Web/SiteServer/main.js

-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ var methods = {
8888
}).then(function (response) {
8989
var res = response.data;
9090

91-
}).catch(function (error) {
92-
utils.error($this, error);
9391
}).then(function () {
9492
$this.create();
9593
});

SiteServer.Web/Web.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<add key="SecretKey" value="eef9e4b0d48bf7a5" />
1515

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

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

0 commit comments

Comments
 (0)