Commit d7563092 by 宋毅

tj

parent 16972ca1
...@@ -212,6 +212,7 @@ class tmqueryCtl extends CtlBase { ...@@ -212,6 +212,7 @@ class tmqueryCtl extends CtlBase {
return system.getResultSuccess({ encryptChannelUserId: req.session.userPinInfo.encryptChannelUserId }); return system.getResultSuccess({ encryptChannelUserId: req.session.userPinInfo.encryptChannelUserId });
} }
this.logClient.info("jd","getUserInfo----->req参数:" + JSON.stringify(pobj)); this.logClient.info("jd","getUserInfo----->req参数:" + JSON.stringify(pobj));
// console.log();
var authUrl = pobj.authUrl; var authUrl = pobj.authUrl;
var authToken = pobj.authToken; var authToken = pobj.authToken;
var actionProcess = pobj.actionProcess; var actionProcess = pobj.actionProcess;
......
...@@ -2,7 +2,7 @@ var childproc = require('child_process'); ...@@ -2,7 +2,7 @@ var childproc = require('child_process');
const util = require('util'); const util = require('util');
const exec = util.promisify(require('child_process').exec); const exec = util.promisify(require('child_process').exec);
const uuidv4 = require('uuid/v4'); const uuidv4 = require('uuid/v4');
const system = require("../system"); // const system = require("../system");
class ExecClient { class ExecClient {
constructor() { constructor() {
this.cmdPostPattern = "curl -k -H 'Content-type: application/json' -d '{data}' {url}"; this.cmdPostPattern = "curl -k -H 'Content-type: application/json' -d '{data}' {url}";
...@@ -10,7 +10,7 @@ class ExecClient { ...@@ -10,7 +10,7 @@ class ExecClient {
this.cmdPostTK = "curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}"; this.cmdPostTK = "curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}";
this.cmdJDPostTK = "curl -k -H 'Content-type:text/plain;charset=UTF-8' -H 'metadata:true' -H 'Authorization:{tk}' -d '{data}' {url}"; this.cmdJDPostTK = "curl -k -H 'Content-type:text/plain;charset=UTF-8' -H 'metadata:true' -H 'Authorization:{tk}' -d '{data}' {url}";
this.logClient = system.getObject("util.logClient"); // this.logClient = system.getObject("util.logClient");
} }
getUUID() { getUUID() {
var uuid = uuidv4(); var uuid = uuidv4();
...@@ -22,7 +22,8 @@ class ExecClient { ...@@ -22,7 +22,8 @@ class ExecClient {
var result = await this.exec(cmd, { var result = await this.exec(cmd, {
maxBuffer: 1024 * 1024 * 15 maxBuffer: 1024 * 1024 * 15
}); });
this.logClient.info("jd", "getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->result:" + result.stdout); console.log("getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->result:" + result.stdout);
// this.logClient.info("jd", "getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->result:" + result.stdout);
var rtn = result.stdout; var rtn = result.stdout;
if (rtn) { if (rtn) {
return JSON.parse(rtn); return JSON.parse(rtn);
...@@ -35,8 +36,8 @@ class ExecClient { ...@@ -35,8 +36,8 @@ class ExecClient {
var requestId = this.getUUID(); var requestId = this.getUUID();
var cmd = this.cmdJDPostTK.replace(/\{data\}/g, var cmd = this.cmdJDPostTK.replace(/\{data\}/g,
data).replace(/\{url\}/g, url).replace(/\{tk\}/g, token); data).replace(/\{url\}/g, url).replace(/\{tk\}/g, token);
console.log(cmd); console.log("getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->" + cmd);
this.logClient.info("jd", "getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->" + cmd); // this.logClient.info("jd", "getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->" + cmd);
return cmd; return cmd;
} }
async execPostTK(subData, url, token) { async execPostTK(subData, url, token) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"type": "file", "type": "file",
"filename": "logs/infoFile/info", "filename": "logs/infoFile/info",
"encoding": "utf-8", "encoding": "utf-8",
"maxLogSize": 10000, "maxLogSize": 1000000,
"backups": 5, "backups": 5,
"pattern": "-yyyy-MM-dd-hh.log", "pattern": "-yyyy-MM-dd-hh.log",
"category": "info_file" "category": "info_file"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
"type": "file", "type": "file",
"filename": "logs/errorFile/error", "filename": "logs/errorFile/error",
"encoding": "utf-8", "encoding": "utf-8",
"maxLogSize": 10000, "maxLogSize": 1000000,
"backups": 5, "backups": 5,
"pattern": "-yyyy-MM-dd-hh.log", "pattern": "-yyyy-MM-dd-hh.log",
"category": "error_file" "category": "error_file"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
var system = require("../../base/system"); var system = require("../../base/system");
var metaCtl = system.getObject("web.common.metaCtl"); var metaCtl = system.getObject("web.common.metaCtl");
var tmqueryCtl = system.getObject("web.trademark.tmqueryCtl"); var tmqueryCtl = system.getObject("web.trademark.tmqueryCtl");
var logClient = system.getObject("util.logClient"); // var logClient = system.getObject("util.logClient");
module.exports = function (app) { module.exports = function (app) {
app.get("/jdtm/getUser", async function (req, res) { app.get("/jdtm/getUser", async function (req, res) {
try { try {
...@@ -32,7 +32,8 @@ module.exports = function (app) { ...@@ -32,7 +32,8 @@ module.exports = function (app) {
var skipUrl = "/#/jd/" + params.state + "?channelUserId=" + encodeURIComponent(userItemResult.data.encryptChannelUserId); var skipUrl = "/#/jd/" + params.state + "?channelUserId=" + encodeURIComponent(userItemResult.data.encryptChannelUserId);
res.redirect(skipUrl); res.redirect(skipUrl);
} catch (error) { } catch (error) {
this.logClient.error("jd", "req---->/jdtm/getUser---->error:" + error.stack); console.log("req---->/jdtm/getUser---->error:" + error.stack);
// logClient.error("jd", "req---->/jdtm/getUser---->error:" + error.stack);
} }
}); });
app.get("/jdtm/getUserTest", async function (req, res) { app.get("/jdtm/getUserTest", async function (req, res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment