Authored by shuaiguo

feat(reg):增加百度ocpc上报日志

@@ -14,6 +14,7 @@ const config = require('../../../config/common'); @@ -14,6 +14,7 @@ const config = require('../../../config/common');
14 const simpleHeaderModel = require('../../../doraemon/models/simple-header'); 14 const simpleHeaderModel = require('../../../doraemon/models/simple-header');
15 let helpers = global.yoho.helpers; 15 let helpers = global.yoho.helpers;
16 let cookie = global.yoho.cookie; 16 let cookie = global.yoho.cookie;
  17 +let logger = global.yoho.logger;
17 18
18 class BaiduSDK { 19 class BaiduSDK {
19 /* 20 /*
@@ -27,6 +28,7 @@ class BaiduSDK { @@ -27,6 +28,7 @@ class BaiduSDK {
27 token = '7GULUkX90QLZU6cHO9OEqUsRKttGNqpN@O62eFfb91OUVhmkakV1bQHIxF8xURBvP', 28 token = '7GULUkX90QLZU6cHO9OEqUsRKttGNqpN@O62eFfb91OUVhmkakV1bQHIxF8xURBvP',
28 conversionTypes = [{ logidUrl: '', newType: null }] 29 conversionTypes = [{ logidUrl: '', newType: null }]
29 }) { 30 }) {
  31 + logger.info('--------------百度ocpc--------------');
30 request({ 32 request({
31 method: 'POST', 33 method: 'POST',
32 uri: 'http://ocpc.baidu.com/ocpcapi/api/uploadConvertData', 34 uri: 'http://ocpc.baidu.com/ocpcapi/api/uploadConvertData',
@@ -36,9 +38,9 @@ class BaiduSDK { @@ -36,9 +38,9 @@ class BaiduSDK {
36 }, 38 },
37 json: true 39 json: true
38 }).then((result) => { 40 }).then((result) => {
39 - console.log(`[账号注册成功后上报 百度ocpc返回信息:${JSON.stringify(result)}`); 41 + logger.info(`[账号注册成功后上报 百度ocpc返回信息:${JSON.stringify(result)}`);
40 }).catch((error) => { 42 }).catch((error) => {
41 - console.log(`[账号注册成功后上报 百度ocpc失败 错误信息:${error}`); 43 + logger.info(`[账号注册成功后上报 百度ocpc失败 错误信息:${error}`);
42 }); 44 });
43 } 45 }
44 } 46 }
@@ -226,6 +228,7 @@ let mobileRegister = (req, res, next) => { @@ -226,6 +228,7 @@ let mobileRegister = (req, res, next) => {
226 */ 228 */
227 const logidUrl = req.cookies.bd_vid_path; 229 const logidUrl = req.cookies.bd_vid_path;
228 230
  231 + logger.info('-------logidUrl--------', `${logidUrl}:${mobile}`);
229 if (logidUrl) { 232 if (logidUrl) {
230 BaiduSDK.reportOcpcApi({ 233 BaiduSDK.reportOcpcApi({
231 conversionTypes: { 234 conversionTypes: {
1 { 1 {
2 "name": "yohobuy-node", 2 "name": "yohobuy-node",
3 - "version": "6.9.19", 3 + "version": "6.9.20",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {