You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
635 B

<?php
namespace app\base\controller\demo\api;
use EasyWeChat\Factory;
use think\App;
class Mpweixin extends Base
{
protected $easyWechatMpWeixinConfig; //easywechat微信小程序配置文件
/**
* 检测文本敏感词
* @date 2022-01-05
*/
public function msgSecCheck()
{
$content = '你好';
$app = Factory::miniProgram($this->easyWechatMpWeixinConfig);
$result = $app->content_security->checkText($content);
if ($result['errcode'] != 0) {
return sendErrorMessage($result['errcode'], $result['errmsg']);
}
dump($result);
}
}