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
Hide 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){
...
@@ -17,17 +17,13 @@ exports.createUser=function(entity,callback){
//根据Uid获取用户
//根据Uid获取用户
exports
.
getUserByUid
=
function
(
uid
,
callback
){
exports
.
getUserByUid
=
function
(
uid
,
callback
){
console
.
log
(
'==============uid:'
+
uid
);
ForumUser
.
findOne
({
uid
:
uid
}).
exec
(
function
(
err
,
result
){
ForumUser
.
findOne
({
uid
:
uid
}).
exec
(
function
(
err
,
result
){
if
(
err
){
if
(
err
){
callback
(
err
,
null
);
callback
(
err
,
null
);
}
else
{
}
else
{
console
.
log
(
'==============result:'
+
result
);
if
(
result
){
if
(
result
){
console
.
log
(
'=================in a'
);
callback
(
null
,
result
);
callback
(
null
,
result
);
}
else
{
}
else
{
console
.
log
(
'=================in b'
);
callback
(
null
,
null
);
callback
(
null
,
null
);
}
}
}
}
...
...
app/utils/user.js
View file @
059b8dbc
...
@@ -21,37 +21,47 @@ exports.getOpenId=function(req){
...
@@ -21,37 +21,47 @@ exports.getOpenId=function(req){
exports
.
identifyUser
=
function
()
{
exports
.
identifyUser
=
function
()
{
return
function
(
req
,
res
,
next
){
return
function
(
req
,
res
,
next
){
forumUserService
.
getUserByUid
(
req
.
session
.
openUser
.
openId
,
function
(
err
,
doc
){
if
(
!
req
.
session
.
mobileForumUser
){
if
(
err
){
forumUserService
.
getUserByUid
(
req
.
session
.
openUser
.
openId
,
function
(
err
,
doc
){
next
(
err
);
if
(
err
){
}
else
{
next
(
err
);
if
(
doc
){
req
.
session
.
mobileForumUser
=
{
userId
:
doc
.
_id
,
openId
:
doc
.
uid
};
next
(
null
);
}
else
{
}
else
{
var
entity
=
{
if
(
doc
)
{
uid
:
req
.
session
.
openUser
.
openId
,
req
.
session
.
mobileForumUser
=
{
nickName
:
req
.
session
.
openUser
.
nickName
,
userId
:
doc
.
_id
,
icon
:
req
.
session
.
openUser
.
headPic
,
openId
:
doc
.
uid
ent_code
:
req
.
session
.
user
.
ent_code
};
}
;
next
(
null
)
;
forumUserService
.
createUser
(
entity
,
function
(
err
,
doc
)
{
}
else
{
if
(
err
){
if
(
req
.
session
.
tmpOpenId
){
next
(
err
);
next
(
null
);
}
else
{
}
else
{
req
.
session
.
mobileForumUser
=
{
req
.
session
.
tmpOpenId
=
req
.
session
.
openUser
.
openId
;
userId
:
doc
.
_id
,
var
entity
=
{
openId
:
doc
.
uid
uid
:
req
.
session
.
openUser
.
openId
,
nickName
:
req
.
session
.
openUser
.
nickName
,
icon
:
req
.
session
.
openUser
.
headPic
,
ent_code
:
req
.
session
.
user
.
ent_code
};
};
next
(
null
);
forumUserService
.
createUser
(
entity
,
function
(
err
,
doc
){
if
(
err
){
next
(
err
);
}
else
{
req
.
session
.
mobileForumUser
=
{
userId
:
doc
.
_id
,
openId
:
doc
.
uid
};
next
(
null
);
}
});
}
}
}
);
}
}
}
}
});
});
}
else
{
next
(
null
);
}
}
}
}
}
\ No newline at end of file
config/config.js
View file @
059b8dbc
...
@@ -23,8 +23,7 @@ var config = {
...
@@ -23,8 +23,7 @@ var config = {
bucketNameDev
:
'pisns-oss-dev'
,
bucketNameDev
:
'pisns-oss-dev'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
devCDNURL
:
'http://dev.fs.wxpai.cn/'
devCDNURL
:
'http://dev.fs.wxpai.cn/'
},
}
indexUrl
:
'http://www.baidu.com'
},
},
test
:
{
test
:
{
...
@@ -46,8 +45,7 @@ var config = {
...
@@ -46,8 +45,7 @@ var config = {
bucketNameDev
:
'pisns-oss-dev'
,
bucketNameDev
:
'pisns-oss-dev'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
devCDNURL
:
'http://dev.fs.wxpai.cn/'
devCDNURL
:
'http://dev.fs.wxpai.cn/'
},
}
indexUrl
:
''
},
},
...
@@ -71,8 +69,7 @@ var config = {
...
@@ -71,8 +69,7 @@ var config = {
bucketNameDev
:
'pisns-oss-dev'
,
bucketNameDev
:
'pisns-oss-dev'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
prodCDNURL
:
'http://fs.wxpai.cn/'
,
devCDNURL
:
'http://dev.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