New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wx-sensitive-words

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wx-sensitive-words - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

25

index.js

@@ -17,4 +17,17 @@ const axios = require("axios");

class WX {
/**
* APPID
* @type {string}
*/
appid = null;
/**
* 小程序秘钥
* @type {string}
*/
secret = null;
/**
* 小程序版本
* @type {"release"|"trial"|"develop"}
*/
env_version = null;
openid = "";

@@ -25,5 +38,6 @@ accessToken = {

};
constructor(appid, secret) {
constructor(appid, secret, env_version = "release") {
this.appid = appid;
this.secret = secret;
this.env_version = env_version;
}

@@ -109,3 +123,3 @@

* @param {String} scene
* @param {{env_version:string;width:number;auto_color:boolean;line_color:{r:number;g:number;b:number}}} data
* @param {{width:number;auto_color:boolean;line_color:{r:number;g:number;b:number}}} data 其他参数,参考微信官方文档
* @returns {Promise<buffer>}

@@ -123,7 +137,8 @@ */

`https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=${access_token}`,
{ page, scene, ...data },{ responseType: 'arraybuffer'}
{ page, scene, env_version: this.env_version, ...data },
{ responseType: "arraybuffer" }
)
.then(({ data }) => {
const res = data.toString()
if (res.indexOf("errmsg")>=0) {
const res = data.toString();
if (res.indexOf("errmsg") >= 0) {
reject(JSON.parse(res).errmsg);

@@ -130,0 +145,0 @@ return;

2

package.json
{
"name": "wx-sensitive-words",
"version": "1.1.0",
"version": "1.1.1",
"description": "微信小程序敏感词查询",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -26,2 +26,11 @@ # 使用微信小程序的敏感词过滤机制

});
// 获取小程序二维码
const filePath = `./static/fileName.png`;
const result = await wx.getWxacodeunlimit("pages/code/code", "scene", {
check_path: false,
width: 280,
});
// 保存到本地
fs.writeFileSync(filePath, result);
```
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