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
e4dbf14a
Commit
e4dbf14a
authored
Jul 23, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3
parent
3e41d6e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
10 deletions
+44
-10
forumIdentifyUser.js
app/controllers/admin/forumIdentifyUser.js
+44
-10
No files found.
app/controllers/admin/forumIdentifyUser.js
View file @
e4dbf14a
...
...
@@ -38,11 +38,9 @@ function compareTime(now, begin_time, end_time) {
var
checkLimitAction
=
function
(
req
,
res
)
{
var
mid
=
req
.
session
.
mobileForumUser
.
userId
;
console
.
log
(
'mid:'
+
mid
);
if
(
mid
){
var
array
=
[];
forumLimitActionRefService
.
getLimitActionRefByMid
(
mid
,
function
(
err
,
forumLimitActionRef
){
console
.
log
(
'forumLimitActionRef:'
+
forumLimitActionRef
);
if
(
err
)
{
console
.
error
(
err
);
res
.
json
(
'success'
);
...
...
@@ -78,9 +76,6 @@ var checkLimitAction = function(req, res) {
//验证用户身份
router
.
post
(
'/user/identifyUser'
,
function
(
req
,
res
,
next
){
console
.
log
(
'check identifyUser'
);
var
entity
=
req
.
body
;
req
.
session
.
mobileForumUser
=
null
;
if
(
!
req
.
session
.
mobileForumUser
){
...
...
@@ -95,8 +90,8 @@ router.post('/user/identifyUser',function(req,res,next){
userId
:
doc
.
_id
,
openId
:
doc
.
uid
};
checkLimitAction
(
req
,
res
);
//
res.json('success');
//
checkLimitAction(req, res);
res
.
json
(
'success'
);
}
else
{
forumUserService
.
createUser
(
entity
,
function
(
err
,
doc
){
if
(
err
){
...
...
@@ -107,8 +102,8 @@ router.post('/user/identifyUser',function(req,res,next){
userId
:
doc
.
_id
,
openId
:
doc
.
uid
};
checkLimitAction
(
req
,
res
);
//
res.json('success');
//
checkLimitAction(req, res);
res
.
json
(
'success'
);
}
});
}
...
...
@@ -142,4 +137,43 @@ router.get('/user/from/share', function(req, res, next) {
// httpService.sendRequest(ent_code,mid,action);
// res.status(200).end();
});
\ No newline at end of file
});
//微信分享带来用户
router
.
get
(
'/user/from/checkLimitAction'
,
function
(
req
,
res
,
next
)
{
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
;
console
.
log
(
'------------'
);
console
.
log
(
req
.
session
.
mobileForumUser
);
console
.
log
(
'------------'
);
res
.
json
(
'success'
);
}
else
{
req
.
session
.
mobileForumUser
.
limit_actions
=
null
;
res
.
json
(
'success'
);
}
}
});
}
else
{
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