Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

awesome-wechat-sdk

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

awesome-wechat-sdk - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

1

lib/wechat.d.ts

@@ -85,4 +85,5 @@ import { AxiosRequestConfig } from 'axios';

getAuthUser(openid: string, lang?: 'zh_CN' | 'zh_TW' | 'en'): Promise<UserInfo>;
getOpenidByCode(code: string): Promise<string>;
getAuthUserByCode(code: string, lang?: 'zh_CN' | 'zh_TW' | 'en'): Promise<UserInfo>;
private verifyToken(openid, accessToken);
}

@@ -92,3 +92,3 @@ "use strict";

};
this.axiosInstance = axios_1.default.create({ responseType: 'json' });
this.axiosInstance = axios_1.default.create();
this.appid = appid;

@@ -125,3 +125,5 @@ this.appsecret = appsecret;

setOpts(opts) {
this.axiosInstance.defaults = opts;
Object.keys(opts).forEach((key) => {
this.axiosInstance.defaults[key] = opts[key];
});
}

@@ -245,2 +247,7 @@ getAccessToken() {

}
getOpenidByCode(code) {
return this.getAuthAccessToken(code).then((token) => {
return token.openid;
});
}
getAuthUserByCode(code, lang = 'zh_CN') {

@@ -247,0 +254,0 @@ return this.getAuthAccessToken(code).then((token) => {

2

package.json
{
"name": "awesome-wechat-sdk",
"version": "1.0.0",
"version": "1.0.1",
"description": "an awesome sdk for wechat oauth and api",

@@ -5,0 +5,0 @@ "scripts": {

@@ -165,6 +165,8 @@ import axios, {AxiosRequestConfig, AxiosInstance, AxiosPromise} from 'axios';

private axiosInstance: AxiosInstance = axios.create({responseType: 'json'});
private axiosInstance: AxiosInstance = axios.create();
setOpts(opts: AxiosRequestConfig) {
this.axiosInstance.defaults = opts;
Object.keys(opts).forEach((key) => {
this.axiosInstance.defaults[key] = opts[key];
});
}

@@ -297,2 +299,8 @@

getOpenidByCode(code: string): Promise<string> {
return this.getAuthAccessToken(code).then((token) => {
return token.openid;
});
}
getAuthUserByCode(code: string, lang: 'zh_CN' | 'zh_TW' | 'en' = 'zh_CN'): Promise<UserInfo> {

@@ -299,0 +307,0 @@ return this.getAuthAccessToken(code).then((token) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc