Huge News!Announcing our $40M Series B led by Abstract Ventures.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.1 to 1.2.0

2

index.js

@@ -88,3 +88,3 @@ const axios = require("axios");

*/
checkout(content, openid = this.openid, scene = 2) {
sensitiveWords(content, openid = this.openid, scene = 2) {
return new Promise(async (resolve, reject) => {

@@ -91,0 +91,0 @@ if (!openid) {

{
"name": "wx-sensitive-words",
"version": "1.1.1",
"description": "微信小程序敏感词查询",
"version": "1.2.0",
"description": "微信小程序敏感词查询等常用功能",
"main": "index.js",

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

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

const WX = require("wx-sensitive-words");
const sensitiveWords = new WX("appid", "secret");
const wx = new WX("appid", "secret");
// 建议此方法在用户打开小程序时调用,获取用户openid,WX类会保留最后一次获取到的openid
sensitiveWords.getOpenid("小程序code");
wx.getOpenid("小程序code");
// 检查是否包含敏感词,第二个参数为两小时内进入过小程序的用户openid,如果两小时内调用过`getOpenid`方法,则无需传入此参数
sensitiveWords.sensitiveWords("敏感词", "openid").then(({ bool, message }) => {
wx.sensitiveWords("敏感词", "openid").then(({ bool, message }) => {
if (bool) {

@@ -22,0 +22,0 @@ // 包含敏感词

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