laravel-qcloud-content-audit icon indicating copy to clipboard operation
laravel-qcloud-content-audit copied to clipboard

提示 You are not authorized to perform this operation.

Open gyp719 opened this issue 1 year ago • 4 comments

使用同一个账号密钥 用官方包 "tencentcloud/tencentcloud-sdk-php": "^3.0", 可以正常识别

使用 overtrue/laravel-qcloud-content-audit

image

gyp719 avatar Jul 20 '23 07:07 gyp719

$res = \Overtrue\LaravelQcs\Tms::mask('这是敏感内容哦');

dd($res) ;

问下, 是我哪里设置的不对吗? 可以指导下?

gyp719 avatar Jul 28 '23 08:07 gyp719

贴代码

overtrue avatar Jul 28 '23 08:07 overtrue

安装成功后, 在 services.php 文件设置 密钥,

` // 文字识别服务 'tms' => [ 'secret_id' => env('TMS_SECRET_ID', ''), 'secret_key' => env('TMS_SECRET_KEY', ''), // 'endpoint' => env('TMS_ENDPOINT', 'tms.tencentcloudapi.com'), // // 可选,默认使用腾讯云默认策略 // 'biz_type' => env('TMS_BIZ_TYPE'), // 可选,开启后跳过 tms 识别/打码功能 // 'dry' => env('TMS_DRY', true), ],

// 图片审核/识别服务
'ims' => [
    'secret_id' => env('IMS_SECRET_ID'),
    'secret_key' => env('IMS_SECRET_KEY'),
    'endpoint' => env('IMS_ENDPOINT'),

    // 可选,默认使用腾讯云默认策略
    'biz_type' => env('IMS_BIZ_TYPE'),
    // 可选,开启后跳过 ims 识别功能
    'dry' => env('IMS_DRY', false),
],`

调用使用

    $res = \Overtrue\LaravelQcs\Tms::mask('这是敏感内容哦');

    dd($res) ;

gyp719 avatar Jul 28 '23 08:07 gyp719

这个报错是腾讯云报的,就是你的账号没有添加 cam 相关授权,所以检查你的 IMS_SECRET_ID 对应的权限。

overtrue avatar Aug 07 '23 03:08 overtrue