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
56897d49
Commit
56897d49
authored
Sep 14, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/0914_IdentifyUser_bug' into SANDBOX
parents
7febc459
03c96076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
67 deletions
+3
-67
forumIdentifyUser.js
app/controllers/admin/forumIdentifyUser.js
+3
-67
No files found.
app/controllers/admin/forumIdentifyUser.js
View file @
56897d49
...
...
@@ -9,9 +9,6 @@ var moment = require('moment');
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
forumLimitOperationService
=
require
(
'../../service/forumLimitOperationService'
);
...
...
@@ -44,7 +41,9 @@ function compareTime(now, begin_time, end_time) {
//验证用户身份
router
.
post
(
'/user/identifyUser'
,
function
(
req
,
res
,
next
){
var
entity
=
req
.
body
;
if
(
!
req
.
session
.
mobileForumUser
){
if
(
req
.
session
.
mobileForumUser
&&
req
.
session
.
mobileForumUser
.
openId
===
entity
.
openId
){
res
.
json
({
result
:
'success'
,
userId
:
req
.
session
.
mobileForumUser
.
userId
});
}
else
if
(
!
req
.
session
.
mobileForumUser
||
req
.
session
.
mobileForumUser
.
openId
!==
entity
.
openId
){
forumUserService
.
getUserByUid
(
entity
.
uid
,
function
(
err
,
doc
){
if
(
err
){
console
.
log
(
err
);
...
...
@@ -55,7 +54,6 @@ router.post('/user/identifyUser',function(req,res,next){
userId
:
doc
.
_id
,
openId
:
doc
.
uid
};
// checkLimitAction(req, res);
res
.
json
({
result
:
'success'
,
userId
:
doc
.
_id
});
}
else
{
forumUserService
.
createUser
(
entity
,
function
(
err
,
doc
){
...
...
@@ -67,7 +65,6 @@ router.post('/user/identifyUser',function(req,res,next){
userId
:
doc
.
_id
,
openId
:
doc
.
uid
};
// checkLimitAction(req, res);
res
.
json
({
result
:
'success'
,
userId
:
doc
.
_id
});
}
});
...
...
@@ -178,64 +175,3 @@ router.post('/user/checkLimitAction', function(req, res, next) {
}
});
//检查用户权限
// router.post('/user/checkLimitAction', function(req, res, next) {
// var entity=req.body;
// var userId = entity.mid;
// if(userId){
// forumLimitActionConfigService.getAllLimitActionConfig(function(err,configs){
// if(err){
// console.error(err);
// res.json(returnCode.BUSY);
// }else{k
// var array = [];
// forumLimitActionRefService.getLimitActionRefByMid(userId,function(err,forumLimitActionRef){
// if (err) {
// console.error(err);
// var returnObject = {
// errcode:'success',
// configs:configs,
// data:array
// }
// res.json(returnObject);
// } 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