Commit ac313f1d by 宋毅

tj

parent 910515de
var WEBBase = require("../../web.base");
var APIBase = require("../../api.base");
var system = require("../../../system");
class ChannelAccessAuthAPI extends WEBBase {
class ChannelAccessAuthAPI extends APIBase {
constructor() {
super();
this.utilsuserSve = system.getObject("service.utilsSve.utilsuserSve");
......
......@@ -156,6 +156,9 @@ class AppServiceBase {
return system.getResult(null, "execGet data is empty");
}
var result = JSON.parse(rtn.stdout);
if(!result.status){
return system.getResultSuccess(result);
}
return result;
}
......
var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
const logCtl = system.getObject("service.common.oplogSve");
//商标查询操作
class UtilsUserSve extends AppServiceBase {
constructor() {
super();
this.apppaliparamDao = system.getObject("db.dbapp.apppaliparamDao");
this.logCtl = system.getObject("service.common.oplogSve");
}
async getH5AliDingUserByCode(pobj) {
var item = await this.apppaliparamDao.getItemByUAppId(Number(pobj.appInfo.uapp_id || 0));
......@@ -28,11 +28,11 @@ class UtilsUserSve extends AppServiceBase {
if (accessTokenResult.status != 0) {
return accessTokenResult;
}
if (accessTokenResult.errcode != 0) {
return system.getResult(null, accessTokenResult.errmsg);
if (accessTokenResult.data.errcode != 0) {
return system.getResult(null, accessTokenResult.data.errmsg);
}
param = {
access_token: accessTokenResult.access_token,
access_token: accessTokenResult.data.access_token,
code: pobj.actionBody.code
};
var userResult = await this.execGetUrl(param, "https://oapi.dingtalk.com/user/getuserinfo");
......@@ -46,13 +46,13 @@ class UtilsUserSve extends AppServiceBase {
if (userResult.status != 0) {
return userResult;
}
if (userResult.errcode != 0) {
return system.getResult(null, userResult.errmsg + "-userResult");
if (userResult.data.errcode != 0) {
return system.getResult(null, userResult.data.errmsg + "-userResult");
}
return system.getResultSuccess({
channelUserId: userResult.userid,
isAdmin: userResult.is_sys && userResult.is_sys == true ? 1 : 0,
isSuper: userResult.sys_level && userResult.sys_level == 1 ? 1 : 0
channelUserId: userResult.data.userid,
isAdmin: userResult.data.is_sys && userResult.data.is_sys == true ? 1 : 0,
isSuper: userResult.data.sys_level && userResult.data.sys_level == 1 ? 1 : 0
});
}
......
......@@ -5,7 +5,7 @@ const exec = util.promisify(require('child_process').exec);
class ExecClient {
constructor() {
this.cmdPostPattern = "curl --user admines:adminGSBes. -k -H 'Content-type: application/json' -d '{data}' {url}";
this.cmdGetPattern = "curl -G -X GET '{url}'";
this.cmdGetPattern = "curl -G -X GET -d '{data}' '{url}'";
this.cmdPushDataPostPattern = "curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}";
}
......@@ -58,8 +58,14 @@ class ExecClient {
}
FetchGetCmd(subData, url) {
var tmpSubData = null;
if (Object.keys(subData).length > 0) {
tmpSubData = Object.keys(subData).map(key => {
return `${encodeURIComponent(key)}=${encodeURIComponent(subData[key])}`
}).join('&');
}
var cmd = this.cmdGetPattern.replace(
/\{data\}/g, subData).replace(/\{url\}/g, url);
/\{data\}/g, tmpSubData).replace(/\{url\}/g, url);
console.log(cmd);
return cmd;
}
......
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