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
b2911383
Commit
b2911383
authored
Apr 22, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
论坛 - 分享
parent
bbbf4b7b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
5 deletions
+21
-5
forumPVLog.js
app/models/forumPVLog.js
+4
-1
forumUVLog.js
app/models/forumUVLog.js
+4
-1
httpService.js
app/service/httpService.js
+2
-1
user.js
app/utils/user.js
+11
-2
No files found.
app/models/forumPVLog.js
View file @
b2911383
...
@@ -49,7 +49,10 @@ var ForumPVLogSchema = new Schema({
...
@@ -49,7 +49,10 @@ var ForumPVLogSchema = new Schema({
index
:
true
index
:
true
},
},
source
:
{
//分享者
source
:
{
//分享者
type
:
String
type
:
String
,
require
:
true
,
index
:
true
,
ref
:
'ForumUser'
},
},
ip
:
{
//IP地址
ip
:
{
//IP地址
type
:
String
type
:
String
...
...
app/models/forumUVLog.js
View file @
b2911383
...
@@ -49,7 +49,10 @@ var ForumUVLogSchema = new Schema({
...
@@ -49,7 +49,10 @@ var ForumUVLogSchema = new Schema({
index
:
true
index
:
true
},
},
source
:
{
//分享者
source
:
{
//分享者
type
:
String
type
:
String
,
require
:
true
,
index
:
true
,
ref
:
'ForumUser'
},
},
ip
:
{
//IP地址
ip
:
{
//IP地址
type
:
String
type
:
String
...
...
app/service/httpService.js
View file @
b2911383
...
@@ -50,10 +50,11 @@ var getClientIP = function(req) {
...
@@ -50,10 +50,11 @@ var getClientIP = function(req) {
return
ipAddress
;
return
ipAddress
;
};
};
exports
.
createLog
=
function
(
req
,
info
,
type
,
thread_type
,
thread
,
p_thread
)
{
exports
.
createLog
=
function
(
req
,
source
,
info
,
type
,
thread_type
,
thread
,
p_thread
)
{
var
logObj
=
{
var
logObj
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
ent_code
:
req
.
session
.
user
.
ent_code
,
source
:
source
,
mid
:
req
.
session
.
openUser
.
mid
,
mid
:
req
.
session
.
openUser
.
mid
,
open_id
:
req
.
session
.
mobileForumUser
.
openId
,
open_id
:
req
.
session
.
mobileForumUser
.
openId
,
user
:
req
.
session
.
mobileForumUser
.
userId
,
user
:
req
.
session
.
mobileForumUser
.
userId
,
...
...
app/utils/user.js
View file @
b2911383
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
var
forumUserService
=
require
(
'../service/forumUserService'
);
var
forumUserService
=
require
(
'../service/forumUserService'
);
exports
.
getMobileUser
=
function
(
req
){
exports
.
getMobileUser
=
function
(
req
){
//
return req.session.mobileForumUser.userId;
return
req
.
session
.
mobileForumUser
.
userId
;
return
'55015675868b65a028187c49'
;
//
return '55015675868b65a028187c49';
}
}
exports
.
getOpenId
=
function
(
req
){
exports
.
getOpenId
=
function
(
req
){
...
@@ -24,6 +24,10 @@ exports.identifyUser=function() {
...
@@ -24,6 +24,10 @@ exports.identifyUser=function() {
userId
:
doc
.
_id
,
userId
:
doc
.
_id
,
openId
:
doc
.
uid
openId
:
doc
.
uid
};
};
if
(
req
.
session
.
source
){
req
.
session
.
mobileForumUser
.
source
=
req
.
session
.
source
;
delete
req
.
session
.
source
;
}
next
(
null
);
next
(
null
);
}
else
{
}
else
{
if
(
req
.
session
.
tmpOpenId
){
if
(
req
.
session
.
tmpOpenId
){
...
@@ -44,6 +48,11 @@ exports.identifyUser=function() {
...
@@ -44,6 +48,11 @@ exports.identifyUser=function() {
userId
:
doc
.
_id
,
userId
:
doc
.
_id
,
openId
:
doc
.
uid
openId
:
doc
.
uid
};
};
if
(
req
.
session
.
source
){
req
.
session
.
mobileForumUser
.
source
=
req
.
session
.
source
;
delete
req
.
session
.
source
;
}
next
(
null
);
next
(
null
);
}
}
});
});
...
...
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