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
0291c3f5
Commit
0291c3f5
authored
Jul 23, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
44
parent
2b37d12b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
34 deletions
+41
-34
forumIdentifyUser.js
app/controllers/admin/forumIdentifyUser.js
+41
-34
No files found.
app/controllers/admin/forumIdentifyUser.js
View file @
0291c3f5
...
...
@@ -10,6 +10,7 @@ var forumUserService=require('../../service/forumUserService');
var
forumThreadService
=
require
(
'../../service/forumThreadService'
);
var
httpService
=
require
(
'../../service/httpService'
);
var
forumLimitActionRefService
=
require
(
'../../service/forumLimitActionRefService'
);
var
forumLimitActionConfigService
=
require
(
'../../service/forumLimitActionConfigService'
);
var
async
=
require
(
'async'
);
...
...
@@ -59,9 +60,6 @@ var checkLimitAction = function(req, res) {
array
.
push
(
obj
);
}
req
.
session
.
mobileForumUser
.
limit_actions
=
array
;
console
.
log
(
'------------'
);
console
.
log
(
req
.
session
.
mobileForumUser
);
console
.
log
(
'------------'
);
res
.
json
(
'success'
);
}
else
{
req
.
session
.
mobileForumUser
.
limit_actions
=
null
;
...
...
@@ -142,43 +140,52 @@ router.post('/user/checkLimitAction', function(req, res, next) {
var
entity
=
req
.
body
;
var
mid
=
entity
.
mid
;
if
(
mid
){
var
array
=
[];
forumLimitActionRefService
.
getLimitActionRefByMid
(
mid
,
function
(
err
,
forumLimitActionRef
){
if
(
err
)
{
forumLimitActionConfigService
.
getAllLimitActionConfig
(
function
(
err
,
configs
){
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
);
}
var
returnObject
=
{
errcode
:
'success'
,
data
:
array
}
res
.
json
(
returnObject
);
}
else
{
var
returnObject
=
{
errcode
:
'success'
,
data
:[]
}
res
.
json
(
returnObject
);
}
res
.
json
(
returnCode
.
BUSY
);
}
else
{
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
);
}
var
returnObject
=
{
errcode
:
'success'
,
configs
:
configs
,
data
:
array
}
res
.
json
(
returnObject
);
}
else
{
var
returnObject
=
{
errcode
:
'success'
,
configs
:
configs
,
data
:[]
}
res
.
json
(
returnObject
);
}
}
});
}
});
}
else
{
var
returnObject
=
{
errcode
:
'success'
,
configs
:
configs
,
data
:[]
}
res
.
json
(
returnObject
);
...
...
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