Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
front-end-dev
techbook
Commits
d13af01d
Commit
d13af01d
authored
Oct 27, 2020
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
敏感词提示
parent
1528d50a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
144 additions
and
88 deletions
+144
-88
commonApi.js
src/common/commonApi.js
+44
-38
faceCmpt.vue
src/components/mobile/faceCmpt.vue
+50
-24
faceCmpt1.vue
src/components/mobile/faceCmpt1.vue
+50
-26
No files found.
src/common/commonApi.js
View file @
d13af01d
import
api
from
"../api/api"
;
import
api
from
"../api/api"
;
import
Qs
from
'qs'
;
import
Qs
from
'qs'
;
let
baseUrl
=
"/business"
;
let
baseUrl
=
"/business"
;
export
default
{
export
default
{
tipInfo
()
{
tipInfo
()
{
return
api
.
fetchPost
(
'/business/tip/tipInfo'
);
return
api
.
fetchPost
(
'/business/tip/tipInfo'
);
},
},
//获取感兴趣字典表接口
//获取感兴趣字典表接口
getIntersetedDictAxios
(){
getIntersetedDictAxios
()
{
return
api
.
fetchLoadingPost
(
'/business/content/selectBaseDataList'
);
return
api
.
fetchLoadingPost
(
'/business/content/selectBaseDataList'
);
},
},
//提交感兴趣领域标签
//提交感兴趣领域标签
postIntersetedDictAxios
(
params
){
postIntersetedDictAxios
(
params
)
{
return
api
.
fetchLoadingPost
(
'/business/content/addEmpDataLabel'
,
params
);
return
api
.
fetchLoadingPost
(
'/business/content/addEmpDataLabel'
,
params
);
},
},
//获取用户选择标签
//获取用户选择标签
getUserIntersetedFlagAxios
(){
getUserIntersetedFlagAxios
()
{
return
api
.
fetchLoadingPost
(
'/business/content/selectEmpDataLabelList'
)
return
api
.
fetchLoadingPost
(
'/business/content/selectEmpDataLabelList'
)
},
},
//获取项目
//获取项目
selectProjectAxios
(
params
){
selectProjectAxios
(
params
)
{
return
api
.
fetchLoadingLogin
(
'/business/search/project'
,
params
);
return
api
.
fetchLoadingLogin
(
'/business/search/project'
,
params
);
},
},
//翻译未登录
//翻译未登录
transNoLoginAxios
(
params
){
transNoLoginAxios
(
params
)
{
return
api
.
fetchLoadingLogin
(
baseUrl
+
"/trans/commonTrans"
,
params
);
return
api
.
fetchLoadingLogin
(
baseUrl
+
"/trans/commonTrans"
,
params
);
},
},
//获取企业列表
//获取企业列表
getBigBusinessListAxios
(
params
){
getBigBusinessListAxios
(
params
)
{
return
api
.
fetchLoadingLogin
(
baseUrl
+
"/search/business"
,
params
);
return
api
.
fetchLoadingLogin
(
baseUrl
+
"/search/business"
,
params
);
},
},
//搜索文章
//搜索文章
searchArticleAxios
(
params
){
searchArticleAxios
(
params
)
{
return
api
.
fetchLoadingGet
(
"/business/search/article?"
+
Qs
.
stringify
(
params
));
return
api
.
fetchLoadingGet
(
"/business/search/article?"
+
Qs
.
stringify
(
params
));
},
},
//活动报名列表分页
//活动报名列表分页
getActivityListAxios
(
params
){
getActivityListAxios
(
params
)
{
return
api
.
fetchLoadingGet
(
"/base/channel/searchActivity?"
+
Qs
.
stringify
(
params
));
return
api
.
fetchLoadingGet
(
"/base/channel/searchActivity?"
+
Qs
.
stringify
(
params
));
},
},
//为你推荐
//为你推荐
recommendedAxios
(
params
){
recommendedAxios
(
params
)
{
return
api
.
fetchGet
(
"/base/channel/searchActivityRecommend?"
+
Qs
.
stringify
(
params
));
return
api
.
fetchGet
(
"/base/channel/searchActivityRecommend?"
+
Qs
.
stringify
(
params
));
},
},
getChannelListAxios
(){
getChannelListAxios
()
{
return
api
.
fetchLoadingLogin
(
"/business/content/selectContentChannelList"
);
return
api
.
fetchLoadingLogin
(
"/business/content/selectContentChannelList"
);
},
},
//获取config
//获取config
getConfigAxios
(
params
){
getConfigAxios
(
params
)
{
return
api
.
fetchLoadingLogin
(
"/base/login/wxWebShare"
,
Qs
.
stringify
(
params
));
return
api
.
fetchLoadingLogin
(
"/base/login/wxWebShare"
,
Qs
.
stringify
(
params
));
},
},
getDocumentAxios
(){
getDocumentAxios
()
{
return
api
.
fetchLogin
(
'/base/tools/selectBasicParams'
);
return
api
.
fetchLogin
(
'/base/tools/selectBasicParams'
);
},
},
//埋点
//埋点
maiDianAxios
(
params
){
maiDianAxios
(
params
)
{
return
api
.
fetchLogin
(
"/business/log/activityLog"
,
params
);
return
api
.
fetchLogin
(
"/business/log/activityLog"
,
params
);
},
},
//热门搜索
//热门搜索
hotSearchAxios
(){
hotSearchAxios
()
{
return
api
.
fetchGet
(
"/business/search/getHotWords"
);
return
api
.
fetchGet
(
"/business/search/getHotWords"
);
},
},
//历史搜索
//历史搜索
historySearchAxios
(
params
){
historySearchAxios
(
params
)
{
return
api
.
fetchGet
(
"/business/search/getHistoryWords?"
+
Qs
.
stringify
(
params
));
return
api
.
fetchGet
(
"/business/search/getHistoryWords?"
+
Qs
.
stringify
(
params
));
},
},
//删除历史搜索
//删除历史搜索
deleteSearchAxios
(
params
){
deleteSearchAxios
(
params
)
{
return
api
.
fetchLogin
(
"/business/search/mvHistoryWords?"
+
Qs
.
stringify
(
params
))
return
api
.
fetchLogin
(
"/business/search/mvHistoryWords?"
+
Qs
.
stringify
(
params
))
},
},
//获取海外国家
//获取海外国家
selectNationList
()
{
selectNationList
()
{
return
api
.
fetchGet
(
baseUrl
+
'/geo/selectNationList'
);
return
api
.
fetchGet
(
baseUrl
+
'/geo/selectNationList'
);
},
},
//获取专家评论的话题/文章/项目
//获取专家评论的话题/文章/项目
selectProfessorCommentList
(
params
){
selectProfessorCommentList
(
params
)
{
return
api
.
fetchLoadingLogin
(
"/base/professor/selectProfessorCommentList"
,
params
)
return
api
.
fetchLoadingLogin
(
"/base/professor/selectProfessorCommentList"
,
params
)
},
},
//用户是否关注公众号
//用户是否关注公众号
isHasAttentionWechatCodeAxios
(){
isHasAttentionWechatCodeAxios
()
{
return
api
.
fetchGet
(
"/base/emp/getUserSubscribeInfo"
)
return
api
.
fetchGet
(
"/base/emp/getUserSubscribeInfo"
)
},
},
//做完任务的提示是否送积分
//做完任务的提示是否送积分
hasTaskIntegralAxios
(
params
){
hasTaskIntegralAxios
(
params
)
{
return
api
.
fetchGet
(
"/base/integralShow/addIntegral?integralCode="
+
params
);
return
api
.
fetchGet
(
"/base/integralShow/addIntegral?integralCode="
+
params
);
},
},
//点赞送积分
//点赞送积分
hasHotIntegralAxios
(
params
){
hasHotIntegralAxios
(
params
)
{
return
api
.
fetchLoadingPost
(
"/base/integralShow/addIntegralByParam"
,
params
);
return
api
.
fetchLoadingPost
(
"/base/integralShow/addIntegralByParam"
,
params
);
}
},
//敏感词检测
checkSensitiveContent
(
params
)
{
return
api
.
fetchLogin
(
'/business/sensitive/checkSensitiveContent'
,
params
);
},
}
}
src/components/mobile/faceCmpt.vue
View file @
d13af01d
...
@@ -116,6 +116,7 @@
...
@@ -116,6 +116,7 @@
import
api
from
'../../views/mobile/proFeedback/api'
;
import
api
from
'../../views/mobile/proFeedback/api'
;
import
{
Toast
}
from
'mint-ui'
;
import
{
Toast
}
from
'mint-ui'
;
import
topicApi
from
'../../views/mobile/topic/api'
;
import
topicApi
from
'../../views/mobile/topic/api'
;
import
commonApi
from
"../../common/commonApi"
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -524,33 +525,58 @@
...
@@ -524,33 +525,58 @@
},
1000
)
},
1000
)
},
},
//发布
//敏感词检测
handlePublish
()
{
checkIsErrorComment
(
content
){
if
(
this
.
textareaMap
[
0
]){
let
params
=
{
let
commentObj
,
discussObj
;
content
:
content
if
(
this
.
commentType
==
1
&&!
this
.
isPublic
)
{
}
discussObj
=
{
commonApi
.
checkSensitiveContent
(
params
).
then
((
res
)
=>
{
discussContent
:
this
.
textareaMap
[
0
],
if
(
res
.
code
==
0
){
discussUrl
:
this
.
imgList
.
join
(
","
),
let
commentObj
,
discussObj
;
projectName
:
this
.
projectName
,
if
(
this
.
commentType
==
1
&&!
this
.
isPublic
)
{
projectIds
:
this
.
projectIds
discussObj
=
{
};
discussContent
:
this
.
textareaMap
[
0
],
}
discussUrl
:
this
.
imgList
.
join
(
","
),
if
(
this
.
isPublic
){
projectName
:
this
.
projectName
,
commentObj
=
{
projectIds
:
this
.
projectIds
commentsContent
:
this
.
textareaMap
[
0
],
};
commentsState
:
this
.
isPublicComment
}
if
(
this
.
isPublic
){
commentObj
=
{
commentsContent
:
this
.
textareaMap
[
0
],
commentsState
:
this
.
isPublicComment
}
}
if
(
this
.
disabledFlag
==
0
){
this
.
disabledFlag
++
;
if
(
this
.
commentType
==
1
&&!
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
discussObj
);
if
(
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
commentObj
);
if
(
this
.
commentType
==
0
&&!
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
this
.
textareaMap
[
0
])
this
.
timeoutFunc
();
}
else
{
this
.
timeoutFunc
();
}
}
}
}
if
(
this
.
disabledFlag
==
0
){
else
{
this
.
disabledFlag
++
;
this
.
$toast
({
if
(
this
.
commentType
==
1
&&!
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
discussObj
);
message
:
res
.
msg
,
if
(
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
commentObj
);
duration
:
3000
,
if
(
this
.
commentType
==
0
&&!
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
this
.
textareaMap
[
0
])
className
:
'noticeError'
this
.
timeoutFunc
();
})
}
else
{
this
.
timeoutFunc
();
}
}
}).
catch
((
err
)
=>
{
this
.
$toast
({
message
:
err
,
duration
:
3000
,
className
:
'noticeError'
})
})
},
//发布
handlePublish
()
{
if
(
this
.
textareaMap
[
0
]){
this
.
checkIsErrorComment
(
this
.
textareaMap
[
0
])
}
else
{
}
else
{
this
.
$toast
({
this
.
$toast
({
...
...
src/components/mobile/faceCmpt1.vue
View file @
d13af01d
...
@@ -172,6 +172,7 @@
...
@@ -172,6 +172,7 @@
import
topicApi
from
'../../views/mobile/topic/api'
;
import
topicApi
from
'../../views/mobile/topic/api'
;
import
$
from
'jquery'
;
import
$
from
'jquery'
;
import
Clickoutside
from
'../../assets/js/clickoutside'
import
Clickoutside
from
'../../assets/js/clickoutside'
import
commonApi
from
"../../common/commonApi"
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -634,36 +635,59 @@
...
@@ -634,36 +635,59 @@
},
1000
)
},
1000
)
},
},
//发布
//敏感词检测
handlePublish
()
{
checkIsErrorComment
(
content
){
if
(
this
.
textareaMap
[
0
])
{
let
params
=
{
let
commentObj
,
discussObj
;
content
:
content
if
(
this
.
commentType
==
1
&&
!
this
.
isPublic
)
{
}
discussObj
=
{
commonApi
.
checkSensitiveContent
(
params
).
then
((
res
)
=>
{
discussContent
:
this
.
textareaMap
[
0
],
if
(
res
.
code
==
0
){
discussUrl
:
this
.
imgList
.
join
(
","
),
let
commentObj
,
discussObj
;
projectName
:
this
.
projectName
,
if
(
this
.
commentType
==
1
&&
!
this
.
isPublic
)
{
projectIds
:
this
.
projectIds
,
discussObj
=
{
topicId
:
this
.
isTopicList
?(
this
.
currentSecondTopic
?
this
.
currentSecondTopic
:
this
.
currentFirstTopic
):
undefined
discussContent
:
this
.
textareaMap
[
0
],
};
discussUrl
:
this
.
imgList
.
join
(
","
),
}
projectName
:
this
.
projectName
,
if
(
this
.
isPublic
)
{
projectIds
:
this
.
projectIds
,
commentObj
=
{
topicId
:
this
.
isTopicList
?(
this
.
currentSecondTopic
?
this
.
currentSecondTopic
:
this
.
currentFirstTopic
):
undefined
commentsContent
:
this
.
textareaMap
[
0
],
};
commentsState
:
this
.
isPublicComment
}
if
(
this
.
isPublic
)
{
commentObj
=
{
commentsContent
:
this
.
textareaMap
[
0
],
commentsState
:
this
.
isPublicComment
}
}
if
(
this
.
disabledFlag
==
0
)
{
this
.
disabledFlag
++
;
if
(
this
.
commentType
==
1
&&
!
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
discussObj
);
if
(
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
commentObj
);
if
(
this
.
commentType
==
0
&&
!
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
this
.
textareaMap
[
0
])
this
.
timeoutFunc
();
}
else
{
this
.
timeoutFunc
();
}
}
}
}
if
(
this
.
disabledFlag
==
0
)
{
else
{
this
.
disabledFlag
++
;
this
.
$toast
({
if
(
this
.
commentType
==
1
&&
!
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
discussObj
);
message
:
res
.
msg
,
if
(
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
commentObj
);
duration
:
3000
,
if
(
this
.
commentType
==
0
&&
!
this
.
isPublic
)
this
.
$emit
(
"publishComment"
,
this
.
textareaMap
[
0
])
className
:
'noticeError'
this
.
timeoutFunc
();
})
}
else
{
this
.
timeoutFunc
();
}
}
}).
catch
((
err
)
=>
{
this
.
$toast
({
message
:
err
,
duration
:
3000
,
className
:
'noticeError'
})
})
},
//发布
handlePublish
()
{
if
(
this
.
textareaMap
[
0
])
{
this
.
checkIsErrorComment
(
this
.
textareaMap
[
0
])
}
else
{
}
else
{
this
.
$toast
({
this
.
$toast
({
message
:
"请输入评论内容"
,
message
:
"请输入评论内容"
,
...
...
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