Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
46bfc13e
Commit
46bfc13e
authored
May 12, 2016
by
刘文胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
帖子加share_pic字段用于后台设置分享图片,修改分享帖子的逻辑
parent
d0959197
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
forumShare.js
app/controllers/mobile/forumShare.js
+4
-2
forumThread.js
app/models/forumThread.js
+5
-2
No files found.
app/controllers/mobile/forumShare.js
View file @
46bfc13e
...
@@ -490,8 +490,10 @@ router.get('/sharev2.js', function(req, res, next) {
...
@@ -490,8 +490,10 @@ router.get('/sharev2.js', function(req, res, next) {
}
}
desc
=
thread
.
content
?
thread
.
content
.
replace
(
/<
\/?
.+
?
>/g
,
""
).
replace
(
/ /g
,
""
).
replace
(
/
\t
/g
,
""
).
replace
(
/
\n
/g
,
""
):
''
;
desc
=
thread
.
content
?
thread
.
content
.
replace
(
/<
\/?
.+
?
>/g
,
""
).
replace
(
/ /g
,
""
).
replace
(
/
\t
/g
,
""
).
replace
(
/
\n
/g
,
""
):
''
;
// 分享图标:帖子带图片则使用第一张图片,否则使用发帖者的头像
// 分享图标:帖子设置了share_pic就使用share_pic ,否则帖子带图片则使用第一张图片,否则使用发帖者的头像
if
(
thread
.
images
&&
thread
.
images
[
0
]){
if
(
thread
.
share_pic
){
imgUrl
=
thread
.
share_pic
;
}
else
if
(
thread
.
images
&&
thread
.
images
[
0
]){
imgUrl
=
thread
.
images
[
0
].
urlFileName
;
imgUrl
=
thread
.
images
[
0
].
urlFileName
;
}
else
{
}
else
{
imgUrl
=
thread
.
from
.
displayIcon
||
thread
.
from
.
icon
||
thread
.
info
.
icon
;
imgUrl
=
thread
.
from
.
displayIcon
||
thread
.
from
.
icon
||
thread
.
info
.
icon
;
...
...
app/models/forumThread.js
View file @
46bfc13e
...
@@ -78,8 +78,11 @@ var ForumThreadSchema = new Schema({
...
@@ -78,8 +78,11 @@ var ForumThreadSchema = new Schema({
comments
:
[{
type
:
Schema
.
Types
.
ObjectId
,
ref
:
'ForumComment'
}],
//评论内容列表
comments
:
[{
type
:
Schema
.
Types
.
ObjectId
,
ref
:
'ForumComment'
}],
//评论内容列表
images
:
{
//文章图片列表
images
:
{
//文章图片列表
type
:
Array
type
:
Array
},
},
share
:
{
//自定义分享
share_pic
:{
//帖子分享图标
type
:
String
},
share
:
{
//自定义分享(已弃用,后台管理没有设置的页面了)
type
:
Schema
.
Types
.
ObjectId
,
type
:
Schema
.
Types
.
ObjectId
,
ref
:
'ForumShare'
ref
:
'ForumShare'
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment