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
43a2e2b3
Commit
43a2e2b3
authored
Dec 02, 2015
by
strong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remould_1123_share'
parents
8d1972c5
7e6754c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
forumShare.js
app/controllers/mobile/forumShare.js
+20
-4
forumThread.js
app/controllers/mobile/forumThread.js
+9
-2
No files found.
app/controllers/mobile/forumShare.js
View file @
43a2e2b3
...
@@ -260,13 +260,22 @@ function getWXV2(res, title, desc, link, imgUrl, mid,ent_code, id,type,forumThre
...
@@ -260,13 +260,22 @@ function getWXV2(res, title, desc, link, imgUrl, mid,ent_code, id,type,forumThre
title
=
title
?
title
.
replace
(
/{文章标题}|{话题名称}|{照片墙标题}/g
,
forumThread
.
title
):
''
;
title
=
title
?
title
.
replace
(
/{文章标题}|{话题名称}|{照片墙标题}/g
,
forumThread
.
title
):
''
;
desc
=
desc
?
desc
.
replace
(
/{文章标题}|{话题名称}|{照片墙标题}/g
,
forumThread
.
content
):
''
;
desc
=
desc
?
desc
.
replace
(
/{文章标题}|{话题名称}|{照片墙标题}/g
,
forumThread
.
content
):
''
;
}
}
if
(
desc
&&
desc
.
length
>
30
){
if
(
desc
&&
desc
.
length
>
30
){
desc
=
desc
.
substr
(
0
,
30
);
desc
=
desc
.
substr
(
0
,
30
);
}
else
if
(
!
desc
){
}
else
if
(
!
desc
){
desc
=
''
;
desc
=
''
;
}
}
var
tempTitle
=
""
;
if
(
!
title
){
tempTitle
=
desc
;
}
else
{
tempTitle
=
title
;
}
res
.
json
({
res
.
json
({
title
:
title
,
title
:
t
empT
itle
,
desc
:
desc
,
desc
:
desc
,
link
:
link
,
link
:
link
,
imgUrl
:
imgUrl
,
imgUrl
:
imgUrl
,
...
@@ -333,7 +342,7 @@ router.get('/sharev2.js', function(req, res, next) {
...
@@ -333,7 +342,7 @@ router.get('/sharev2.js', function(req, res, next) {
case
1
:
//文章
case
1
:
//文章
link
=
link
+
'detail'
;
link
=
link
+
'detail'
;
share_type
=
'article'
;
share_type
=
'article'
;
title
=
thread
.
title
==
'发话题'
?
thread
.
info
.
name
:
thread
.
title
;
title
=
thread
.
title
==
'发话题'
?
""
:
thread
.
title
;
break
;
break
;
case
2
:
//话题
case
2
:
//话题
if
(
thread
.
level
===
2
){
if
(
thread
.
level
===
2
){
...
@@ -358,8 +367,15 @@ router.get('/sharev2.js', function(req, res, next) {
...
@@ -358,8 +367,15 @@ router.get('/sharev2.js', function(req, res, next) {
}
}
break
;
break
;
}
}
desc
=
thread
.
content
?
thread
.
content
.
replace
(
/<
\/?
.+
?
>/g
,
""
).
replace
(
/ /g
,
""
):
''
;
desc
=
thread
.
content
?
thread
.
content
.
replace
(
/<
\/?
.+
?
>/g
,
""
).
replace
(
/ /g
,
""
).
replace
(
/
\t
/g
,
""
).
replace
(
/
\n
/g
,
""
):
''
;
imgUrl
=
thread
.
from
.
displayIcon
||
thread
.
from
.
icon
||
thread
.
info
.
icon
;
// 分享图标:帖子带图片则使用第一张图片,否则使用发帖者的头像
if
(
thread
.
images
&&
thread
.
images
[
0
]){
imgUrl
=
thread
.
images
[
0
].
urlFileName
;
}
else
{
imgUrl
=
thread
.
from
.
displayIcon
||
thread
.
from
.
icon
||
thread
.
info
.
icon
;
}
link
+=
baseParamsUrl
;
link
+=
baseParamsUrl
;
//获取分享设置
//获取分享设置
if
(
thread
.
share_type
!==
2
)
{
if
(
thread
.
share_type
!==
2
)
{
...
...
app/controllers/mobile/forumThread.js
View file @
43a2e2b3
...
@@ -58,7 +58,14 @@ function create(req, callback) {
...
@@ -58,7 +58,14 @@ function create(req, callback) {
entity
.
images
=
array
;
entity
.
images
=
array
;
}
}
//-----------处理前端上传图片结束
//-----------处理前端上传图片结束
if
(
entity
.
pid
&&
entity
.
type
==
3
)
{
//校验是否全是表情
var
temp_content
=
entity
.
content
;
temp_content
=
temp_content
.
replace
(
/<img
\/?
.+
?
border="0">/g
,
""
);
if
(
!
temp_content
||
temp_content
.
length
<
1
){
callback
(
'content error'
,
null
);
}
else
if
(
entity
.
pid
&&
entity
.
type
==
3
)
{
forumThreadService
.
getByConditions
({
forumThreadService
.
getByConditions
({
type
:
3
,
type
:
3
,
level
:
'2'
,
level
:
'2'
,
...
@@ -473,7 +480,7 @@ router.post('/thread/create', function(req, res, next) {
...
@@ -473,7 +480,7 @@ router.post('/thread/create', function(req, res, next) {
create
(
req
,
function
(
err
,
thread
)
{
create
(
req
,
function
(
err
,
thread
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
_
.
assign
(
err
,
returnCode
.
BUSY
)
);
}
else
{
}
else
{
forumAboutMEService
.
saveThread
(
thread
);
forumAboutMEService
.
saveThread
(
thread
);
forumLimitOperationService
.
checkLimitOperationProhibitionAddIntegral
(
userId
,
function
(
err
,
flag
)
{
forumLimitOperationService
.
checkLimitOperationProhibitionAddIntegral
(
userId
,
function
(
err
,
flag
)
{
...
...
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