Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-external-sdk into dev
This commit is contained in:
commit
3ff3f43728
|
|
@ -86,7 +86,7 @@ export declare class WechatPublicInstance {
|
|||
signatureJsSDK(options: {
|
||||
url: string;
|
||||
}): Promise<{
|
||||
signature: any;
|
||||
signature: string;
|
||||
noncestr: string;
|
||||
timestamp: number;
|
||||
appId: string;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ var tslib_1 = require("tslib");
|
|||
require('../../fetch');
|
||||
var crypto_1 = tslib_1.__importDefault(require("crypto"));
|
||||
var buffer_1 = require("buffer");
|
||||
var sha1 = require('sha1');
|
||||
var WechatPublicInstance = /** @class */ (function () {
|
||||
function WechatPublicInstance(appId, appSecret, accessToken, externalRefreshFn) {
|
||||
this.appId = appId;
|
||||
|
|
@ -523,7 +522,10 @@ var WechatPublicInstance = /** @class */ (function () {
|
|||
zhimaString += contentArray[ele];
|
||||
});
|
||||
return [2 /*return*/, {
|
||||
signature: sha1(zhimaString),
|
||||
signature: crypto_1.default
|
||||
.createHash('sha1')
|
||||
.update(zhimaString)
|
||||
.digest('hex'),
|
||||
noncestr: noncestr,
|
||||
timestamp: timestamp,
|
||||
appId: this.appId,
|
||||
|
|
|
|||
|
|
@ -18,13 +18,11 @@
|
|||
"@types/node": "^17.0.31",
|
||||
"ts-node": "~10.9.1",
|
||||
"tslib": "^2.4.0",
|
||||
"typescript": "~4.7.4",
|
||||
"@types/sha1": "^1.1.3"
|
||||
"typescript": "~4.7.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/pop-core": "^1.7.12",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
"sha1": "^1.1.1",
|
||||
"tencentcloud-sdk-nodejs": "^4.0.525",
|
||||
"ts-md5": "^1.3.1"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
require('../../fetch');
|
||||
import crypto from 'crypto';
|
||||
import { Buffer } from 'buffer';
|
||||
const sha1 = require('sha1');
|
||||
|
||||
// 目前先支持text和news, 其他type文档:https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html
|
||||
// type ServeMessageType = 'text' | 'news' | 'mpnews' | 'mpnewsarticle' | 'image' | 'voice' | 'video' | 'music' | 'msgmenu';/
|
||||
|
|
@ -529,10 +528,13 @@ export class WechatPublicInstance {
|
|||
zhimaString += contentArray[ele as keyof typeof contentArray];
|
||||
});
|
||||
return {
|
||||
signature: sha1(zhimaString),
|
||||
signature: crypto
|
||||
.createHash('sha1')
|
||||
.update(zhimaString)
|
||||
.digest('hex'),
|
||||
noncestr,
|
||||
timestamp,
|
||||
appId: this.appId,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue