wx-sensitive-words
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -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 @@ // 包含敏感词 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5610