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
cc026f9a
Commit
cc026f9a
authored
Jul 23, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2222
parent
0d2cbf75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
39 deletions
+5
-39
forumIdentifyUser.js
app/controllers/admin/forumIdentifyUser.js
+5
-39
No files found.
app/controllers/admin/forumIdentifyUser.js
View file @
cc026f9a
...
...
@@ -37,40 +37,6 @@ function compareTime(now, begin_time, end_time) {
}
}
var
checkLimitAction
=
function
(
req
,
res
)
{
var
mid
=
req
.
session
.
mobileForumUser
.
userId
;
if
(
mid
){
var
array
=
[];
forumLimitActionRefService
.
getLimitActionRefByMid
(
mid
,
function
(
err
,
forumLimitActionRef
){
if
(
err
)
{
console
.
error
(
err
);
res
.
json
(
'success'
);
}
else
{
// 获取到用户行为限制记录
if
(
forumLimitActionRef
){
var
limit_actions
=
forumLimitActionRef
.
limit_actions
;
for
(
var
i
=
0
;
i
<
limit_actions
.
length
;
i
+=
1
)
{
var
limit_action
=
limit_actions
[
i
];
var
flag
=
compareTime
(
new
Date
(),
limit_action
.
begin_time
,
limit_action
.
end_time
);
//把flag和limit_action_type 放进session
var
obj
=
{
result
:
flag
,
code
:
limit_action
.
limit_action_type
}
array
.
push
(
obj
);
}
req
.
session
.
mobileForumUser
.
limit_actions
=
array
;
res
.
json
(
'success'
);
}
else
{
req
.
session
.
mobileForumUser
.
limit_actions
=
null
;
res
.
json
(
'success'
);
}
}
});
}
else
{
res
.
json
(
'success'
);
}
}
//验证用户身份
router
.
post
(
'/user/identifyUser'
,
function
(
req
,
res
,
next
){
...
...
@@ -111,13 +77,13 @@ router.post('/user/identifyUser',function(req,res,next){
});
//微信分享带来用户
router
.
get
(
'/user/from/share'
,
function
(
req
,
res
,
next
)
{
var
userId
=
req
.
session
.
mobileForumUser
.
userId
;
var
mid
=
req
.
query
.
mid
,
action
=
req
.
query
.
action
,
ent_code
=
req
.
query
.
ent_code
;
forumLimitActionRefService
.
checkLimitActionProhibitionAddIntegral
(
mi
d
,
function
(
err
,
flag
){
forumLimitActionRefService
.
checkLimitActionProhibitionAddIntegral
(
userI
d
,
function
(
err
,
flag
){
if
(
err
){
console
.
error
(
err
);
res
.
json
(
returnCode
.
PROHIBITION_OF_SPEECH
);
...
...
@@ -138,15 +104,15 @@ router.get('/user/from/share', function(req, res, next) {
//检查用户权限
router
.
post
(
'/user/checkLimitAction'
,
function
(
req
,
res
,
next
)
{
var
entity
=
req
.
body
;
var
mi
d
=
entity
.
mid
;
if
(
mi
d
){
var
userI
d
=
entity
.
mid
;
if
(
userI
d
){
forumLimitActionConfigService
.
getAllLimitActionConfig
(
function
(
err
,
configs
){
if
(
err
){
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
var
array
=
[];
forumLimitActionRefService
.
getLimitActionRefByMid
(
mi
d
,
function
(
err
,
forumLimitActionRef
){
forumLimitActionRefService
.
getLimitActionRefByMid
(
userI
d
,
function
(
err
,
forumLimitActionRef
){
if
(
err
)
{
console
.
error
(
err
);
res
.
json
(
'success'
);
...
...
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