npm i wx-check-domain
var WxCheckDomain = require('wx-check-domain');
let checker = new WxCheckDomain('your app id ', 'your app secret', 'access_token save path');
let result = await checker.check('http://www.example.com/');
console.log('==== http://www.somebannedsites.com/ ', result); // { code: -1, msg: 'banned' }
let result1 = await checker.check('http://www.maimai.cn');
console.log('==== http://www.maimai.cn/ ', result1); // { code: 0, msg: 'ok' }
v2.0.0
- 根据安全检测链接重定向的链接是否为安全链接来判断是否被微信封禁
v1.0.0
- 检测是否被微信封禁
- 本地存储access_token