Commit d065091a by 宋毅

tj

parent 8fd06d73
...@@ -53,7 +53,7 @@ class APIBase { ...@@ -53,7 +53,7 @@ class APIBase {
async doexec(gname, methodname, pobj, query, req) { async doexec(gname, methodname, pobj, query, req) {
req.requestId = this.getUUID(); req.requestId = this.getUUID();
try { try {
if (["getTokenByHosts", "receiveCallBackNotify", "getAppInfo", "getPayInfo"].indexOf(methodname) < 0) { if (["getTokenByHosts", "receiveCallBackNotify", "getAppInfo", "getPayInfo", "test"].indexOf(methodname) < 0) {
if (!pobj.appInfo) { if (!pobj.appInfo) {
return system.getResult(null, "pobj.appInfo can not be empty !"); return system.getResult(null, "pobj.appInfo can not be empty !");
} }
......
...@@ -22,5 +22,10 @@ class ChannelAccessAuthAPI extends APIBase { ...@@ -22,5 +22,10 @@ class ChannelAccessAuthAPI extends APIBase {
var opResult = await this.utilsuserSve.getDingJsApiAuthentication(pobj); var opResult = await this.utilsuserSve.getDingJsApiAuthentication(pobj);
return opResult; return opResult;
} }
async test(pobj, qobj, req) {
var opResult = await this.utilsuserSve.getJsApiSingnature("ticket", "nonce", "timeStamp", "http://alitm.qifu.gongsibao.com");
return system.getResultSuccess(opResult);
}
} }
module.exports = ChannelAccessAuthAPI; module.exports = ChannelAccessAuthAPI;
\ No newline at end of file
...@@ -72,7 +72,7 @@ class UtilsUserSve extends AppServiceBase { ...@@ -72,7 +72,7 @@ class UtilsUserSve extends AppServiceBase {
timeStamp: timeStamp.toString(), timeStamp: timeStamp.toString(),
nonceStr: nonceStr.toUpperCase() nonceStr: nonceStr.toUpperCase()
}; };
var signature = await this.getJsApiSingnature(ticketResult.data.ticket, parameters.nonceStr, parameters.timeStamp, nowPageUrl); var signature = await this.getJsApiSingnature(pobj, ticketResult.data.ticket, parameters.nonceStr, parameters.timeStamp, nowPageUrl);
parameters.signature = signature; parameters.signature = signature;
return system.getResultSuccess(parameters); return system.getResultSuccess(parameters);
} }
...@@ -134,17 +134,18 @@ class UtilsUserSve extends AppServiceBase { ...@@ -134,17 +134,18 @@ class UtilsUserSve extends AppServiceBase {
* @param {*} timeStamp * @param {*} timeStamp
* @param {*} url * @param {*} url
*/ */
async getJsApiSingnature(ticket, nonce, timeStamp, url) {//获取JsApi鉴权签名信息----本类中调用 async getJsApiSingnature(pobj, ticket, nonce, timeStamp, url) {//获取JsApi鉴权签名信息----本类中调用
let plainTex = "jsapi_ticket=" + ticket + "&noncestr=" + nonce + "&timestamp=" + timeStamp + "&url=" + url; let plainTex = "jsapi_ticket=" + ticket + "&noncestr=" + nonce + "&timestamp=" + timeStamp + "&url=" + url;
// var BufferList= new Buffer(plainTex).toString("base64");
this.logCtl.info({ this.logCtl.info({
// appid: pobj.appInfo ? pobj.appInfo.uapp_id : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id : "",
// appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "", appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "",
// op: "https://oapi.dingtalk.com/get_jsapi_ticket", op: "center-app/app/base/service/impl/utilsSve/utilsuserSve.js/getJsApiSingnature",
content: "参数:" + plainTex, content: "参数:" + plainTex,
optitle: "记录钉钉鉴权签名信息参数", optitle: "记录钉钉鉴权签名信息参数",
}); });
let signature = cryptoJS.SHA1(plainTex).toString(); let signature = cryptoJS.SHA1(plainTex).toString(cryptoJS.enc.Hex); //cryptoJS.SHA1(plainTex).toString();
return signature; return signature;
} }
} }
......
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