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
059b8dbc
Commit
059b8dbc
authored
Mar 25, 2015
by
张淼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fed49d6b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
36 deletions
+39
-36
forumUserService.js
app/service/forumUserService.js
+0
-4
user.js
app/utils/user.js
+36
-26
config.js
config/config.js
+3
-6
No files found.
app/service/forumUserService.js
View file @
059b8dbc
...
...
@@ -17,17 +17,13 @@ exports.createUser=function(entity,callback){
//根据Uid获取用户
exports
.
getUserByUid
=
function
(
uid
,
callback
){
console
.
log
(
'==============uid:'
+
uid
);
ForumUser
.
findOne
({
uid
:
uid
}).
exec
(
function
(
err
,
result
){
if
(
err
){
callback
(
err
,
null
);
}
else
{
console
.
log
(
'==============result:'
+
result
);
if
(
result
){
console
.
log
(
'=================in a'
);
callback
(
null
,
result
);
}
else
{
console
.
log
(
'=================in b'
);
callback
(
null
,
null
);
}
}
...
...
app/utils/user.js
View file @
059b8dbc
...
...
@@ -21,6 +21,7 @@ exports.getOpenId=function(req){
exports
.
identifyUser
=
function
()
{
return
function
(
req
,
res
,
next
){
if
(
!
req
.
session
.
mobileForumUser
){
forumUserService
.
getUserByUid
(
req
.
session
.
openUser
.
openId
,
function
(
err
,
doc
){
if
(
err
){
next
(
err
);
...
...
@@ -32,6 +33,10 @@ exports.identifyUser=function() {
};
next
(
null
);
}
else
{
if
(
req
.
session
.
tmpOpenId
){
next
(
null
);
}
else
{
req
.
session
.
tmpOpenId
=
req
.
session
.
openUser
.
openId
;
var
entity
=
{
uid
:
req
.
session
.
openUser
.
openId
,
nickName
:
req
.
session
.
openUser
.
nickName
,
...
...
@@ -51,7 +56,12 @@ exports.identifyUser=function() {
});
}
}
}
});
}
else
{
next
(
null
);
}
}
}
\ No newline at end of file
config/config.js
View file @
059b8dbc
...
...
@@ -23,8 +23,7 @@ var config = {
bucketNameDev
:
'pisns-oss-dev'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
devCDNURL
:
'http://dev.fs.wxpai.cn/'
},
indexUrl
:
'http://www.baidu.com'
}
},
test
:
{
...
...
@@ -46,8 +45,7 @@ var config = {
bucketNameDev
:
'pisns-oss-dev'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
devCDNURL
:
'http://dev.fs.wxpai.cn/'
},
indexUrl
:
''
}
},
...
...
@@ -71,8 +69,7 @@ var config = {
bucketNameDev
:
'pisns-oss-dev'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
devCDNURL
:
'http://dev.fs.wxpai.cn/'
},
indexUrl
:
''
}
}
};
...
...
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