Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
shuaiguo
5 years ago
Commit
b525875b0fba862f2fa4f9f160ebe9e384a7aaca
1 parent
2b4a0f59
feat(reg):增加百度ocpc上报日志
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
apps/passport/controllers/reg.js
package.json
apps/passport/controllers/reg.js
View file @
b525875
...
...
@@ -14,6 +14,7 @@ const config = require('../../../config/common');
const
simpleHeaderModel
=
require
(
'../../../doraemon/models/simple-header'
);
let
helpers
=
global
.
yoho
.
helpers
;
let
cookie
=
global
.
yoho
.
cookie
;
let
logger
=
global
.
yoho
.
logger
;
class
BaiduSDK
{
/*
...
...
@@ -27,6 +28,7 @@ class BaiduSDK {
token
=
'7GULUkX90QLZU6cHO9OEqUsRKttGNqpN@O62eFfb91OUVhmkakV1bQHIxF8xURBvP'
,
conversionTypes
=
[{
logidUrl
:
''
,
newType
:
null
}]
})
{
logger
.
info
(
'--------------百度ocpc--------------'
);
request
({
method
:
'POST'
,
uri
:
'http://ocpc.baidu.com/ocpcapi/api/uploadConvertData'
,
...
...
@@ -36,9 +38,9 @@ class BaiduSDK {
},
json
:
true
}).
then
((
result
)
=>
{
console
.
log
(
`
[
账号注册成功后上报
百度
ocpc
返回信息:
$
{
JSON
.
stringify
(
result
)}
`
);
logger
.
info
(
`
[
账号注册成功后上报
百度
ocpc
返回信息:
$
{
JSON
.
stringify
(
result
)}
`
);
}).
catch
((
error
)
=>
{
console
.
log
(
`
[
账号注册成功后上报
百度
ocpc
失败
错误信息:
$
{
error
}
`
);
logger
.
info
(
`
[
账号注册成功后上报
百度
ocpc
失败
错误信息:
$
{
error
}
`
);
});
}
}
...
...
@@ -226,6 +228,7 @@ let mobileRegister = (req, res, next) => {
*/
const
logidUrl
=
req
.
cookies
.
bd_vid_path
;
logger
.
info
(
'-------logidUrl--------'
,
`
$
{
logidUrl
}:
$
{
mobile
}
`
);
if
(
logidUrl
)
{
BaiduSDK
.
reportOcpcApi
({
conversionTypes
:
{
...
...
package.json
View file @
b525875
{
"name"
:
"yohobuy-node"
,
"version"
:
"6.9.
19
"
,
"version"
:
"6.9.
20
"
,
"private"
:
true
,
"description"
:
"A New Yohobuy Project With Express"
,
"repository"
:
{
...
...
Please
register
or
login
to post a comment