├── .gitignore ├── .github ├── FUNDING.yml ├── dependabot.yml ├── stale.yml └── workflows │ ├── update-changelog.yml │ └── dependabot-auto-merge.yml ├── src ├── Core │ ├── IAcsClient.php │ ├── Auth │ │ ├── ISigner.php │ │ ├── ShaHmac1Signer.php │ │ ├── ShaHmac256Signer.php │ │ └── Credential.php │ ├── Profile │ │ ├── IClientProfile.php │ │ └── DefaultProfile.php │ ├── Config.php │ ├── AcsResponse.php │ ├── Http │ │ ├── HttpResponse.php │ │ └── HttpHelper.php │ ├── Regions │ │ ├── ProductDomain.php │ │ ├── Endpoint.php │ │ ├── EndpointProvider.php │ │ ├── EndpointConfig.php │ │ └── endpoints.xml │ ├── Exception │ │ ├── ServerException.php │ │ └── ClientException.php │ ├── Autoloader │ │ └── Autoloader.php │ ├── AcsRequest.php │ ├── RpcAcsRequest.php │ ├── DefaultAcsClient.php │ └── RoaAcsRequest.php ├── config │ └── aliyun.php ├── Green │ ├── TextScanRequest.php │ ├── ImageSyncScanRequest.php │ ├── TextFeedbackRequest.php │ ├── ImageAsyncScanRequest.php │ ├── VideoAsyncScanRequest.php │ ├── VideoFeedbackRequest.php │ ├── ImageScanFeedbackRequest.php │ ├── ImageAsyncScanResultsRequest.php │ └── VideoAsyncScanResultsRequest.php ├── AliGreenServiceProvider.php └── AliGreen.php ├── composer.json ├── LICENSE ├── README.md ├── CHANGELOG.md └── .php-cs-fixer.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .php-cs-fixer.cache 3 | /vendor/ 4 | composer.lock 5 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: https://james.dmzfa.com/about#pay 4 | -------------------------------------------------------------------------------- /src/Core/IAcsClient.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | interface IAcsClient 11 | { 12 | public function doAction($requst); 13 | } 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: composer 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | time: "21:00" 8 | open-pull-requests-limit: 10 9 | 10 | - package-ecosystem: "github-actions" 11 | directory: "/" 12 | schedule: 13 | interval: "daily" 14 | labels: 15 | - "dependencies" 16 | -------------------------------------------------------------------------------- /src/Core/Auth/ISigner.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | interface ISigner 11 | { 12 | public function getSignatureMethod(); 13 | 14 | public function getSignatureVersion(); 15 | 16 | public function signString($source, $accessSecret); 17 | } 18 | -------------------------------------------------------------------------------- /src/Core/Profile/IClientProfile.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | interface IClientProfile 11 | { 12 | public function getSigner(); 13 | 14 | public function getRegionId(); 15 | 16 | public function getFormat(); 17 | 18 | public function getCredential(); 19 | } 20 | -------------------------------------------------------------------------------- /src/Core/Config.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | include_once 'Autoloader/Autoloader.php'; 11 | include_once 'Regions/EndpointConfig.php'; 12 | 13 | //config http proxy 14 | define('ENABLE_HTTP_PROXY', false); 15 | define('HTTP_PROXY_IP', '127.0.0.1'); 16 | define('HTTP_PROXY_PORT', '8888'); 17 | -------------------------------------------------------------------------------- /src/Core/Auth/ShaHmac1Signer.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class ShaHmac1Signer implements ISigner 11 | { 12 | public function signString($source, $accessSecret) 13 | { 14 | return base64_encode(hash_hmac('sha1', $source, $accessSecret, true)); 15 | } 16 | 17 | public function getSignatureMethod() 18 | { 19 | return 'HMAC-SHA1'; 20 | } 21 | 22 | public function getSignatureVersion() 23 | { 24 | return '1.0'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Core/Auth/ShaHmac256Signer.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class ShaHmac256Signer implements ISigner 11 | { 12 | public function signString($source, $accessSecret) 13 | { 14 | return base64_encode(hash_hmac('sha256', $source, $accessSecret, true)); 15 | } 16 | 17 | public function getSignatureMethod() 18 | { 19 | return 'HMAC-SHA256'; 20 | } 21 | 22 | public function getSignatureVersion() 23 | { 24 | return '1.0'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/config/aliyun.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | return [ 11 | // 阿里云 accessKeyId 12 | 'accessKeyId' => '******', 13 | // 阿里云 accessKeySecret 14 | 'accessKeySecret' => '******', 15 | // 支持的场景有:porn(色情)、terrorism(暴恐)、qrcode(二维码)、ad(图片广告)、 ocr(文字识别) 16 | 'scenes' => ['ad', 'porn', 'terrorism', 'qrcode'], 17 | // 地区 上海 18 | 'region' => 'cn-shanghai', 19 | 20 | // 自定义 text 违规内容 21 | 'content' => [ 22 | 'cnm', 23 | 'sb' 24 | ] 25 | ]; 26 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 30 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 3 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: wontfix 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false -------------------------------------------------------------------------------- /src/Core/AcsResponse.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class AcsResponse 11 | { 12 | private $code; 13 | private $message; 14 | 15 | public function getCode() 16 | { 17 | return $this->code; 18 | } 19 | 20 | public function setCode($code) 21 | { 22 | $this->code = $code; 23 | } 24 | 25 | public function getMessage() 26 | { 27 | return $this->message; 28 | } 29 | 30 | public function setMessage($message) 31 | { 32 | $this->message = $message; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.github/workflows/update-changelog.yml: -------------------------------------------------------------------------------- 1 | name: "Update Changelog" 2 | 3 | on: 4 | release: 5 | types: [ released ] 6 | 7 | jobs: 8 | update: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v3 14 | with: 15 | ref: master 16 | 17 | - name: Update Changelog 18 | uses: stefanzweifel/changelog-updater-action@v1 19 | with: 20 | latest-version: ${{ github.event.release.name }} 21 | release-notes: ${{ github.event.release.body }} 22 | 23 | - name: Commit updated CHANGELOG 24 | uses: stefanzweifel/git-auto-commit-action@v5 25 | with: 26 | branch: master 27 | commit_message: Update CHANGELOG 28 | file_pattern: CHANGELOG.md 29 | -------------------------------------------------------------------------------- /src/Core/Http/HttpResponse.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class HttpResponse 11 | { 12 | private $body; 13 | private $status; 14 | 15 | public function getBody() 16 | { 17 | return $this->body; 18 | } 19 | 20 | public function setBody($body) 21 | { 22 | $this->body = $body; 23 | } 24 | 25 | public function getStatus() 26 | { 27 | return $this->status; 28 | } 29 | 30 | public function setStatus($status) 31 | { 32 | $this->status = $status; 33 | } 34 | 35 | public function isSuccess() 36 | { 37 | if (200 <= $this->status && 300 > $this->status) { 38 | return true; 39 | } 40 | 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Green/TextScanRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class TextScanRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'TextScan'); 20 | $this->setUriPattern('/green/text/scan'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Green/ImageSyncScanRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class ImageSyncScanRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'ImageSyncScan'); 20 | $this->setUriPattern('/green/image/scan'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Green/TextFeedbackRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class TextFeedbackRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'TextFeedback'); 20 | $this->setUriPattern('/green/text/feedback'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Green/ImageAsyncScanRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class ImageAsyncScanRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'ImageAsyncScan'); 20 | $this->setUriPattern('/green/image/asyncscan'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Green/VideoAsyncScanRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class VideoAsyncScanRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'VideoAsyncScan'); 20 | $this->setUriPattern('/green/video/asyncscan'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Green/VideoFeedbackRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class VideoFeedbackRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'VideoFeedback'); 20 | $this->setUriPattern('/green/video/feedback'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Green/ImageScanFeedbackRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class ImageScanFeedbackRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'ImageScanFeedback'); 20 | $this->setUriPattern('/green/image/feedback'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Green/ImageAsyncScanResultsRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class ImageAsyncScanResultsRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'ImageAsyncScanResults'); 20 | $this->setUriPattern('/green/image/results'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Green/VideoAsyncScanResultsRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen\Green; 12 | 13 | use RoaAcsRequest; 14 | 15 | class VideoAsyncScanResultsRequest extends RoaAcsRequest 16 | { 17 | public function __construct() 18 | { 19 | parent::__construct('Green', '2017-01-12', 'VideoAsyncScanResults'); 20 | $this->setUriPattern('/green/video/results'); 21 | $this->setMethod('POST'); 22 | } 23 | 24 | private $clientInfo; 25 | 26 | public function getClientInfo() 27 | { 28 | return $this->clientInfo; 29 | } 30 | 31 | public function setClientInfo($clientInfo) 32 | { 33 | $this->clientInfo = $clientInfo; 34 | $this->queryParameters['ClientInfo'] = $clientInfo; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Core/Regions/ProductDomain.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class ProductDomain 11 | { 12 | private $productName; 13 | private $domainName; 14 | 15 | public function __construct($product, $domain) 16 | { 17 | $this->productName = $product; 18 | $this->domainName = $domain; 19 | } 20 | 21 | public function getProductName() 22 | { 23 | return $this->productName; 24 | } 25 | 26 | public function setProductName($productName) 27 | { 28 | $this->productName = $productName; 29 | } 30 | 31 | public function getDomainName() 32 | { 33 | return $this->domainName; 34 | } 35 | 36 | public function setDomainName($domainName) 37 | { 38 | $this->domainName = $domainName; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Core/Exception/ServerException.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class ServerException extends ClientException 11 | { 12 | private $httpStatus; 13 | private $requestId; 14 | 15 | public function __construct($errorMessage, $errorCode, $httpStatus, $requestId) 16 | { 17 | $messageStr = $errorCode . ' ' . $errorMessage . ' HTTP Status: ' . $httpStatus . ' RequestID: ' . $requestId; 18 | parent::__construct($messageStr, $errorCode); 19 | $this->setErrorMessage($errorMessage); 20 | $this->setErrorType('Server'); 21 | $this->httpStatus = $httpStatus; 22 | $this->requestId = $requestId; 23 | } 24 | 25 | public function getHttpStatus() 26 | { 27 | return $this->httpStatus; 28 | } 29 | 30 | public function getRequestId() 31 | { 32 | return $this->requestId; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "james.xue/ali-green", 3 | "license": "MIT", 4 | "homepage": "https://github.com/xiaoxuan6/aliyun-safe.git", 5 | "description": "阿里内容检测,包括文本、关键词文本检测以及对图片涉黄、暴恐、敏感检测、广告、二维码等", 6 | "authors": [ 7 | { 8 | "name": "james.xue", 9 | "email": "1527736751@qq.com" 10 | } 11 | ], 12 | "require": { 13 | "illuminate/support": "~5.0|~6.0|~7.0|~8.0|~9.0|^10.0|^11.0|^12.0" 14 | }, 15 | "autoload": { 16 | "psr-4": { 17 | "James\\AliGreen\\": "src/" 18 | } 19 | }, 20 | "extra": { 21 | "laravel": { 22 | "providers": [ 23 | "James\\AliGreen\\AliGreenServiceProvider" 24 | ], 25 | "aliases": { 26 | "AliGreen" : "James\\AliGreen\\Facades\\AliGreen" 27 | } 28 | } 29 | }, 30 | "require-dev": { 31 | "friendsofphp/php-cs-fixer": "^3.4" 32 | }, 33 | "scripts": { 34 | "fix-style": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no --ansi" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 james.xue <1527736751@qq.com> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /.github/workflows/dependabot-auto-merge.yml: -------------------------------------------------------------------------------- 1 | name: Dependabot auto-merge 2 | 3 | on: pull_request_target 4 | 5 | permissions: 6 | pull-requests: write 7 | contents: write 8 | 9 | jobs: 10 | dependabot: 11 | runs-on: ubuntu-latest 12 | if: ${{ github.actor == 'dependabot[bot]' }} 13 | steps: 14 | - name: Dependabot metadata 15 | id: metadata 16 | uses: dependabot/fetch-metadata@v1.6.0 17 | with: 18 | github-token: "${{ secrets.GITHUB_TOKEN }}" 19 | 20 | - name: Auto-merge Dependabot PRs for semver-minor updates 21 | if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} 22 | run: gh pr merge --auto --merge "$PR_URL" 23 | env: 24 | PR_URL: ${{github.event.pull_request.html_url}} 25 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 26 | 27 | - name: Auto-merge Dependabot PRs for semver-patch updates 28 | if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} 29 | run: gh pr merge --auto --merge "$PR_URL" 30 | env: 31 | PR_URL: ${{github.event.pull_request.html_url}} 32 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} -------------------------------------------------------------------------------- /src/Core/Autoloader/Autoloader.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | spl_autoload_register('Autoloader::autoload'); 11 | class Autoloader 12 | { 13 | private static $autoloadPathArray = [ 14 | 'Core', 15 | 'Core/Auth', 16 | 'Core/Http', 17 | 'Core/Profile', 18 | 'Core/Regions', 19 | 'Core/Exception' 20 | ]; 21 | 22 | public static function autoload($className) 23 | { 24 | foreach (self::$autoloadPathArray as $path) { 25 | $file = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $className . '.php'; 26 | $file = str_replace('\\', DIRECTORY_SEPARATOR, $file); 27 | if (is_file($file)) { 28 | include_once $file; 29 | 30 | break; 31 | } 32 | } 33 | } 34 | 35 | public static function addAutoloadPath($path) 36 | { 37 | array_push(self::$autoloadPathArray, $path); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Core/Regions/Endpoint.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class Endpoint 11 | { 12 | private $name; 13 | private $regionIds; 14 | private $productDomains; 15 | 16 | public function __construct($name, $regionIds, $productDomains) 17 | { 18 | $this->name = $name; 19 | $this->regionIds = $regionIds; 20 | $this->productDomains = $productDomains; 21 | } 22 | 23 | public function getName() 24 | { 25 | return $this->name; 26 | } 27 | 28 | public function setName($name) 29 | { 30 | $this->name = $name; 31 | } 32 | 33 | public function getRegionIds() 34 | { 35 | return $this->regionIds; 36 | } 37 | 38 | public function setRegionIds($regionIds) 39 | { 40 | $this->regionIds = $regionIds; 41 | } 42 | 43 | public function getProductDomains() 44 | { 45 | return $this->productDomains; 46 | } 47 | 48 | public function setProductDomains($productDomains) 49 | { 50 | $this->productDomains = $productDomains; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AliGreen 2 | 3 | 阿里内容检测服务 4 | 5 | 阿里内容检测服务封装,包括垃圾文本、关键词文本检测以及对图片涉黄、暴恐、敏感检测 6 | ### 安装: 7 | 8 | composer require james.xue/ali-safe-api 9 | 10 | ### laravel 应用 11 | 发布 config 12 | 13 | php artisan vendor:publish --tag=aliyun 14 | 15 | ### lumen 应用 16 | 1. 在 `bootstrap/app.php` 中添加: 17 | 18 | ```php 19 | $app->register(\James\AliGreen\AliGreenServiceProvider::class); 20 | ``` 21 | 22 | 2 如果你习惯使用 `config/aliyun.php` 来配置的话,将 `vendor/james.xue/ali-safe-api/src/config/aliyun.php` 拷贝到`项目根目录/config`目录下。 23 | 24 | 25 | ### 使用方法: 26 | 27 | 前提:配置config/aliyun.php 28 | 29 | use James\AliGreen\AliGreen; 30 | 31 | $ali = AliGreen::getInstance(); 32 | 33 | ------------字符串--------------- 34 | 35 | $ali->checkText("约炮"); 36 | 37 | $ali->checkImg("http://nos.netease.com/yidun/2-0-0-4f903f968e6849d3930ef0f50af74fc2.jpg"); 38 | 39 | 40 | ------------数组--------------- 41 | 42 | 文本检测 43 | 44 | $textArr = array("测试", "约炮"); 45 | 46 | $ali->checkText($textArr); 47 | 48 | 图片检测 49 | 50 | $imgArr = array("http://nos.netease.com/yidun/2-0-0-4f903f968e6849d3930ef0f50af74fc2.jpg", "http://blog.jstm365.com/images/page_bg.jpg"); 51 | 52 | $result = $ali->checkImg($imgArr); 53 | 54 | ### 注意事项 55 | 56 | 只有 version`1.3.2`以后才支持`lumen` -------------------------------------------------------------------------------- /src/AliGreenServiceProvider.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen; 12 | 13 | use Illuminate\Support\ServiceProvider; 14 | use Laravel\Lumen\Application as LumenApplication; 15 | use Illuminate\Foundation\Application as LaravelApplication; 16 | 17 | class AliGreenServiceProvider extends ServiceProvider 18 | { 19 | /** 20 | * Bootstrap services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { 27 | $this->publishes([__DIR__ . '/config/aliyun.php' => config_path('aliyun.php')], 'aliyun'); 28 | } elseif ($this->app instanceof LumenApplication) { 29 | $this->app->configure('aliyun'); 30 | } 31 | 32 | $this->mergeConfigFrom(__DIR__ . '/config/aliyun.php', 'aliyun'); 33 | } 34 | 35 | /** 36 | * Register services. 37 | * 38 | * @return void 39 | */ 40 | public function register() 41 | { 42 | $this->app->singleton('aligreen', function ($app) { 43 | return new AliGreen(); 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Core/Exception/ClientException.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class ClientException extends Exception 11 | { 12 | public function __construct($errorMessage, $errorCode) 13 | { 14 | parent::__construct($errorMessage); 15 | $this->errorMessage = $errorMessage; 16 | $this->errorCode = $errorCode; 17 | $this->setErrorType('Client'); 18 | } 19 | 20 | private $errorCode; 21 | private $errorMessage; 22 | private $errorType; 23 | 24 | public function getErrorCode() 25 | { 26 | return $this->errorCode; 27 | } 28 | 29 | public function setErrorCode($errorCode) 30 | { 31 | $this->errorCode = $errorCode; 32 | } 33 | 34 | public function getErrorMessage() 35 | { 36 | return $this->errorMessage; 37 | } 38 | 39 | public function setErrorMessage($errorMessage) 40 | { 41 | $this->errorMessage = $errorMessage; 42 | } 43 | 44 | public function getErrorType() 45 | { 46 | return $this->errorType; 47 | } 48 | 49 | public function setErrorType($errorType) 50 | { 51 | $this->errorType = $errorType; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Core/Regions/EndpointProvider.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class EndpointProvider 11 | { 12 | private static $endpoints; 13 | 14 | public static function findProductDomain($regionId, $product) 15 | { 16 | if ($regionId == null || $product == null || self::$endpoints == null) { 17 | return null; 18 | } 19 | foreach (self::$endpoints as $key => $endpoint) { 20 | if (in_array($regionId, $endpoint->getRegionIds())) { 21 | return self::findProductDomainByProduct($endpoint->getProductDomains(), $product); 22 | } 23 | } 24 | 25 | return null; 26 | } 27 | 28 | private static function findProductDomainByProduct($productDomains, $product) 29 | { 30 | if ($productDomains == null) { 31 | return null; 32 | } 33 | foreach ($productDomains as $key => $productDomain) { 34 | if ($product == $productDomain->getProductName()) { 35 | return $productDomain->getDomainName(); 36 | } 37 | } 38 | 39 | return null; 40 | } 41 | 42 | public static function getEndpoints() 43 | { 44 | return self::$endpoints; 45 | } 46 | 47 | public static function setEndpoints($endpoints) 48 | { 49 | self::$endpoints = $endpoints; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Core/Auth/Credential.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class Credential 11 | { 12 | private $dateTimeFormat = 'Y-m-d\TH:i:s\Z'; 13 | private $refreshDate; 14 | private $expiredDate; 15 | private $accessKeyId; 16 | private $accessSecret; 17 | private $securityToken; 18 | 19 | public function __construct($accessKeyId, $accessSecret) 20 | { 21 | $this->accessKeyId = $accessKeyId; 22 | $this->accessSecret = $accessSecret; 23 | $this->refreshDate = date($this->dateTimeFormat); 24 | } 25 | 26 | public function isExpired() 27 | { 28 | if ($this->expiredDate == null) { 29 | return false; 30 | } 31 | if (strtotime($this->expiredDate) > date($this->dateTimeFormat)) { 32 | return false; 33 | } 34 | 35 | return true; 36 | } 37 | 38 | public function getRefreshDate() 39 | { 40 | return $this->refreshDate; 41 | } 42 | 43 | public function getExpiredDate() 44 | { 45 | return $this->expiredDate; 46 | } 47 | 48 | public function setExpiredDate($expiredHours) 49 | { 50 | if ($expiredHours > 0) { 51 | return $this->expiredDate = date($this->dateTimeFormat, strtotime('+' . $expiredHours . ' hour')); 52 | } 53 | } 54 | 55 | public function getAccessKeyId() 56 | { 57 | return $this->accessKeyId; 58 | } 59 | 60 | public function setAccessKeyId($accessKeyId) 61 | { 62 | $this->accessKeyId = $accessKeyId; 63 | } 64 | 65 | public function getAccessSecret() 66 | { 67 | return $this->accessSecret; 68 | } 69 | 70 | public function setAccessSecret($accessSecret) 71 | { 72 | $this->accessSecret = $accessSecret; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/Core/Regions/EndpointConfig.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | $endpoint_filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'endpoints.xml'; 11 | $xml = simplexml_load_string(file_get_contents($endpoint_filename)); 12 | $json = json_encode($xml); 13 | $json_array = json_decode($json, true); 14 | 15 | $endpoints = []; 16 | 17 | foreach ($json_array['Endpoint'] as $json_endpoint) { 18 | # pre-process RegionId & Product 19 | if (! array_key_exists('RegionId', $json_endpoint['RegionIds'])) { 20 | $region_ids = []; 21 | } else { 22 | $json_region_ids = $json_endpoint['RegionIds']['RegionId']; 23 | if (! is_array($json_region_ids)) { 24 | $region_ids = [$json_region_ids]; 25 | } else { 26 | $region_ids = $json_region_ids; 27 | } 28 | } 29 | 30 | if (! array_key_exists('Product', $json_endpoint['Products'])) { 31 | $products = []; 32 | } else { 33 | $json_products = $json_endpoint['Products']['Product']; 34 | 35 | if ($json_products === [] or ! is_array($json_products)) { 36 | $products = []; 37 | } elseif (array_keys($json_products) !== range(0, count($json_products) - 1)) { 38 | # array is not sequential 39 | $products = [$json_products]; 40 | } else { 41 | $products = $json_products; 42 | } 43 | } 44 | 45 | $product_domains = []; 46 | foreach ($products as $product) { 47 | $product_domain = new ProductDomain($product['ProductName'], $product['DomainName']); 48 | array_push($product_domains, $product_domain); 49 | } 50 | 51 | $endpoint = new Endpoint($region_ids[0], $region_ids, $product_domains); 52 | array_push($endpoints, $endpoint); 53 | } 54 | 55 | EndpointProvider::setEndpoints($endpoints); 56 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `aliyun-safe` will be documented in this file. 4 | 5 | ## v2.1.3 - 2025-04-20 6 | 7 | **Full Changelog**: https://github.com/xiaoxuan6/aliyun-safe/compare/2.1.2...v2.1.3 8 | 9 | ## 2.1.2 - 2024-10-29 10 | 11 | ### What's Changed 12 | 13 | * Bump dependabot/fetch-metadata from 1.3.0 to 1.3.1 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/5 14 | * Bump dependabot/fetch-metadata from 1.3.1 to 1.3.2 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/6 15 | * Bump dependabot/fetch-metadata from 1.3.2 to 1.3.3 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/7 16 | * Bump dependabot/fetch-metadata from 1.3.3 to 1.3.4 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/8 17 | * Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/9 18 | * Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/10 19 | * Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/11 20 | * Bump dependabot/fetch-metadata from 1.4.0 to 1.5.0 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/13 21 | * Bump dependabot/fetch-metadata from 1.5.0 to 1.5.1 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/14 22 | * Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/15 23 | * Bump stefanzweifel/git-auto-commit-action from 4 to 5 by @dependabot in https://github.com/xiaoxuan6/aliyun-safe/pull/17 24 | 25 | ### New Contributors 26 | 27 | * @dependabot made their first contribution in https://github.com/xiaoxuan6/aliyun-safe/pull/5 28 | 29 | **Full Changelog**: https://github.com/xiaoxuan6/aliyun-safe/compare/2.1.1...2.1.2 30 | 31 | ## 2.1.1 - 2022-04-02 32 | 33 | **Full Changelog**: https://github.com/xiaoxuan6/aliyun-safe/compare/2.1.0...2.1.1 34 | 35 | ## 1.0.0 - 202X-XX-XX 36 | 37 | - initial release 38 | -------------------------------------------------------------------------------- /src/Core/Http/HttpHelper.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class HttpHelper 11 | { 12 | public static $connectTimeout = 3;//3 second 13 | public static $readTimeout = 8;//8 second 14 | 15 | public static function curl($url, $httpMethod = 'GET', $postFields = null, $headers = null) 16 | { 17 | $ch = curl_init(); 18 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $httpMethod); 19 | if (ENABLE_HTTP_PROXY) { 20 | curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); 21 | curl_setopt($ch, CURLOPT_PROXY, HTTP_PROXY_IP); 22 | curl_setopt($ch, CURLOPT_PROXYPORT, HTTP_PROXY_PORT); 23 | curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); 24 | } 25 | curl_setopt($ch, CURLOPT_URL, $url); 26 | curl_setopt($ch, CURLOPT_FAILONERROR, false); 27 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 28 | curl_setopt($ch, CURLOPT_POSTFIELDS, is_array($postFields) ? self::getPostHttpBody($postFields) : $postFields); 29 | 30 | if (self::$readTimeout) { 31 | curl_setopt($ch, CURLOPT_TIMEOUT, self::$readTimeout); 32 | } 33 | if (self::$connectTimeout) { 34 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, self::$connectTimeout); 35 | } 36 | //https request 37 | if (strlen($url) > 5 && strtolower(substr($url, 0, 5)) == 'https') { 38 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 39 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 40 | } 41 | if (is_array($headers) && 0 < count($headers)) { 42 | $httpHeaders = self::getHttpHearders($headers); 43 | curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeaders); 44 | } 45 | $httpResponse = new HttpResponse(); 46 | $httpResponse->setBody(curl_exec($ch)); 47 | $httpResponse->setStatus(curl_getinfo($ch, CURLINFO_HTTP_CODE)); 48 | if (curl_errno($ch)) { 49 | throw new ClientException('Server unreachable: Errno: ' . curl_errno($ch) . ' ' . curl_error($ch), 'SDK.ServerUnreachable'); 50 | } 51 | curl_close($ch); 52 | 53 | return $httpResponse; 54 | } 55 | 56 | public static function getPostHttpBody($postFildes) 57 | { 58 | $content = ''; 59 | foreach ($postFildes as $apiParamKey => $apiParamValue) { 60 | $content .= "$apiParamKey=" . urlencode($apiParamValue) . '&'; 61 | } 62 | 63 | return substr($content, 0, -1); 64 | } 65 | 66 | public static function getHttpHearders($headers) 67 | { 68 | $httpHeader = []; 69 | foreach ($headers as $key => $value) { 70 | array_push($httpHeader, $key . ':' . $value); 71 | } 72 | 73 | return $httpHeader; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/Core/AcsRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | abstract class AcsRequest 11 | { 12 | protected $version; 13 | protected $product; 14 | protected $actionName; 15 | protected $regionId; 16 | protected $acceptFormat; 17 | protected $method; 18 | protected $protocolType = 'http'; 19 | protected $content; 20 | 21 | protected $queryParameters = []; 22 | protected $headers = []; 23 | 24 | public function __construct($product, $version, $actionName) 25 | { 26 | $this->headers['x-sdk-client'] = 'php/2.0.0'; 27 | $this->product = $product; 28 | $this->version = $version; 29 | $this->actionName = $actionName; 30 | } 31 | 32 | abstract public function composeUrl($iSigner, $credential, $domain); 33 | 34 | public function getVersion() 35 | { 36 | return $this->version; 37 | } 38 | 39 | public function setVersion($version) 40 | { 41 | $this->version = $version; 42 | } 43 | 44 | public function getProduct() 45 | { 46 | return $this->product; 47 | } 48 | 49 | public function setProduct($product) 50 | { 51 | $this->product = $product; 52 | } 53 | 54 | public function getActionName() 55 | { 56 | return $this->actionName; 57 | } 58 | 59 | public function setActionName($actionName) 60 | { 61 | $this->actionName = $actionName; 62 | } 63 | 64 | public function getAcceptFormat() 65 | { 66 | return $this->acceptFormat; 67 | } 68 | 69 | public function setAcceptFormat($acceptFormat) 70 | { 71 | $this->acceptFormat = $acceptFormat; 72 | } 73 | 74 | public function getQueryParameters() 75 | { 76 | return $this->queryParameters; 77 | } 78 | 79 | public function getHeaders() 80 | { 81 | return $this->headers; 82 | } 83 | 84 | public function getMethod() 85 | { 86 | return $this->method; 87 | } 88 | 89 | public function setMethod($method) 90 | { 91 | $this->method = $method; 92 | } 93 | 94 | public function getProtocol() 95 | { 96 | return $this->protocolType; 97 | } 98 | 99 | public function setProtocol($protocol) 100 | { 101 | $this->protocolType = $protocol; 102 | } 103 | 104 | public function getRegionId() 105 | { 106 | return $this->regionId; 107 | } 108 | 109 | public function setRegionId($region) 110 | { 111 | $this->regionId = $region; 112 | } 113 | 114 | public function getContent() 115 | { 116 | return $this->content; 117 | } 118 | 119 | public function setContent($content) 120 | { 121 | $this->content = $content; 122 | } 123 | 124 | public function addHeader($headerKey, $headerValue) 125 | { 126 | $this->headers[$headerKey] = $headerValue; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/Core/RpcAcsRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | abstract class RpcAcsRequest extends AcsRequest 11 | { 12 | private $dateTimeFormat = 'Y-m-d\TH:i:s\Z'; 13 | private $domainParameters = []; 14 | 15 | public function __construct($product, $version, $actionName) 16 | { 17 | parent::__construct($product, $version, $actionName); 18 | $this->initialize(); 19 | } 20 | 21 | private function initialize() 22 | { 23 | $this->setMethod('GET'); 24 | $this->setAcceptFormat('JSON'); 25 | } 26 | 27 | private function prepareValue($value) 28 | { 29 | if (is_bool($value)) { 30 | if ($value) { 31 | return 'true'; 32 | } 33 | 34 | return 'false'; 35 | } 36 | 37 | return $value; 38 | } 39 | 40 | public function composeUrl($iSigner, $credential, $domain) 41 | { 42 | $apiParams = parent::getQueryParameters(); 43 | foreach ($apiParams as $key => $value) { 44 | $apiParams[$key] = $this->prepareValue($value); 45 | } 46 | $apiParams['RegionId'] = $this->getRegionId(); 47 | $apiParams['AccessKeyId'] = $credential->getAccessKeyId(); 48 | $apiParams['Format'] = $this->getAcceptFormat(); 49 | $apiParams['SignatureMethod'] = $iSigner->getSignatureMethod(); 50 | $apiParams['SignatureVersion'] = $iSigner->getSignatureVersion(); 51 | $apiParams['SignatureNonce'] = uniqid(); 52 | date_default_timezone_set('GMT'); 53 | $apiParams['Timestamp'] = date($this->dateTimeFormat); 54 | $apiParams['Action'] = $this->getActionName(); 55 | $apiParams['Version'] = $this->getVersion(); 56 | $apiParams['Signature'] = $this->computeSignature($apiParams, $credential->getAccessSecret(), $iSigner); 57 | if (parent::getMethod() == 'POST') { 58 | $requestUrl = $this->getProtocol() . '://' . $domain . '/'; 59 | foreach ($apiParams as $apiParamKey => $apiParamValue) { 60 | $this->putDomainParameters($apiParamKey, $apiParamValue); 61 | } 62 | 63 | return $requestUrl; 64 | } 65 | 66 | $requestUrl = $this->getProtocol() . '://' . $domain . '/?'; 67 | 68 | foreach ($apiParams as $apiParamKey => $apiParamValue) { 69 | $requestUrl .= "$apiParamKey=" . urlencode($apiParamValue) . '&'; 70 | } 71 | 72 | return substr($requestUrl, 0, -1); 73 | } 74 | 75 | private function computeSignature($parameters, $accessKeySecret, $iSigner) 76 | { 77 | ksort($parameters); 78 | $canonicalizedQueryString = ''; 79 | foreach ($parameters as $key => $value) { 80 | $canonicalizedQueryString .= '&' . $this->percentEncode($key) . '=' . $this->percentEncode($value); 81 | } 82 | $stringToSign = parent::getMethod() . '&%2F&' . $this->percentencode(substr($canonicalizedQueryString, 1)); 83 | 84 | return $iSigner->signString($stringToSign, $accessKeySecret . '&'); 85 | } 86 | 87 | protected function percentEncode($str) 88 | { 89 | $res = urlencode($str); 90 | $res = preg_replace('/\+/', '%20', $res); 91 | $res = preg_replace('/\*/', '%2A', $res); 92 | 93 | return preg_replace('/%7E/', '~', $res); 94 | } 95 | 96 | public function getDomainParameter() 97 | { 98 | return $this->domainParameters; 99 | } 100 | 101 | public function putDomainParameters($name, $value) 102 | { 103 | $this->domainParameters[$name] = $value; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/Core/Profile/DefaultProfile.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class DefaultProfile implements IClientProfile 11 | { 12 | private static $profile; 13 | private static $endpoints; 14 | private static $credential; 15 | private static $regionId; 16 | private static $acceptFormat; 17 | 18 | private static $isigner; 19 | private static $iCredential; 20 | 21 | private function __construct($regionId, $credential) 22 | { 23 | self::$regionId = $regionId; 24 | self::$credential = $credential; 25 | } 26 | 27 | public static function getProfile($regionId, $accessKeyId, $accessSecret) 28 | { 29 | $credential = new Credential($accessKeyId, $accessSecret); 30 | self::$profile = new DefaultProfile($regionId, $credential); 31 | 32 | return self::$profile; 33 | } 34 | 35 | public function getSigner() 36 | { 37 | if (self::$isigner == null) { 38 | self::$isigner = new ShaHmac1Signer(); 39 | } 40 | 41 | return self::$isigner; 42 | } 43 | 44 | public function getRegionId() 45 | { 46 | return self::$regionId; 47 | } 48 | 49 | public function getFormat() 50 | { 51 | return self::$acceptFormat; 52 | } 53 | 54 | public function getCredential() 55 | { 56 | if (self::$credential == null && self::$iCredential != null) { 57 | self::$credential = self::$iCredential; 58 | } 59 | 60 | return self::$credential; 61 | } 62 | 63 | public static function getEndpoints() 64 | { 65 | if (self::$endpoints == null) { 66 | self::$endpoints = EndpointProvider::getEndpoints(); 67 | } 68 | 69 | return self::$endpoints; 70 | } 71 | 72 | public static function addEndpoint($endpointName, $regionId, $product, $domain) 73 | { 74 | if (self::$endpoints == null) { 75 | self::$endpoints = self::getEndpoints(); 76 | } 77 | $endpoint = self::findEndpointByName($endpointName); 78 | if ($endpoint == null) { 79 | self::addEndpoint_($endpointName, $regionId, $product, $domain); 80 | } else { 81 | self::updateEndpoint($regionId, $product, $domain, $endpoint); 82 | } 83 | } 84 | 85 | public static function findEndpointByName($endpointName) 86 | { 87 | foreach (self::$endpoints as $key => $endpoint) { 88 | if ($endpoint->getName() == $endpointName) { 89 | return $endpoint; 90 | } 91 | } 92 | } 93 | 94 | private static function addEndpoint_($endpointName, $regionId, $product, $domain) 95 | { 96 | $regionIds = [$regionId]; 97 | $productsDomains = [new ProductDomain($product, $domain)]; 98 | $endpoint = new Endpoint($endpointName, $regionIds, $productDomains); 99 | array_push(self::$endpoints, $endpoint); 100 | } 101 | 102 | private static function updateEndpoint($regionId, $product, $domain, $endpoint) 103 | { 104 | $regionIds = $endpoint->getRegionIds(); 105 | if (! in_array($regionId, $regionIds)) { 106 | array_push($regionIds, $regionId); 107 | $endpoint->setRegionIds($regionIds); 108 | } 109 | 110 | $productDomains = $endpoint->getProductDomains(); 111 | if (self::findProductDomain($productDomains, $product, $domain) == null) { 112 | array_push($productDomains, new ProductDomain($product, $domain)); 113 | } 114 | $endpoint->setProductDomains($productDomains); 115 | } 116 | 117 | private static function findProductDomain($productDomains, $product, $domain) 118 | { 119 | foreach ($productDomains as $key => $productDomain) { 120 | if ($productDomain->getProductName() == $product && $productDomain->getDomainName() == $domain) { 121 | return $productDomain; 122 | } 123 | } 124 | 125 | return null; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/Core/DefaultAcsClient.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | class DefaultAcsClient implements IAcsClient 11 | { 12 | public $iClientProfile; 13 | public $__urlTestFlag__; 14 | 15 | public function __construct($iClientProfile) 16 | { 17 | $this->iClientProfile = $iClientProfile; 18 | $this->__urlTestFlag__ = false; 19 | } 20 | 21 | public function getAcsResponse($request, $iSigner = null, $credential = null, $autoRetry = true, $maxRetryNumber = 3) 22 | { 23 | $httpResponse = $this->doActionImpl($request, $iSigner, $credential, $autoRetry, $maxRetryNumber); 24 | $respObject = $this->parseAcsResponse($httpResponse->getBody(), $request->getAcceptFormat()); 25 | if ($httpResponse->isSuccess() == false) { 26 | $this->buildApiException($respObject, $httpResponse->getStatus()); 27 | } 28 | 29 | return $respObject; 30 | } 31 | 32 | private function doActionImpl($request, $iSigner = null, $credential = null, $autoRetry = true, $maxRetryNumber = 3) 33 | { 34 | if ($this->iClientProfile == null && ($iSigner == null || $credential == null 35 | || $request->getRegionId() == null || $request->getAcceptFormat() == null)) { 36 | throw new ClientException('No active profile found.', 'SDK.InvalidProfile'); 37 | } 38 | if ($iSigner == null) { 39 | $iSigner = $this->iClientProfile->getSigner(); 40 | } 41 | if ($credential == null) { 42 | $credential = $this->iClientProfile->getCredential(); 43 | } 44 | $request = $this->prepareRequest($request); 45 | $domain = EndpointProvider::findProductDomain($request->getRegionId(), $request->getProduct()); 46 | if ($domain == null) { 47 | throw new ClientException('Can not find endpoint to access.', 'SDK.InvalidRegionId'); 48 | } 49 | $requestUrl = $request->composeUrl($iSigner, $credential, $domain); 50 | 51 | if ($this->__urlTestFlag__) { 52 | throw new ClientException($requestUrl, 'URLTestFlagIsSet'); 53 | } 54 | 55 | if (count($request->getDomainParameter()) > 0) { 56 | $httpResponse = HttpHelper::curl($requestUrl, $request->getMethod(), $request->getDomainParameter(), $request->getHeaders()); 57 | } else { 58 | $httpResponse = HttpHelper::curl($requestUrl, $request->getMethod(), $request->getContent(), $request->getHeaders()); 59 | } 60 | 61 | while (500 <= $httpResponse->getStatus() && $autoRetry && $retryTimes < $maxRetryNumber) { 62 | $retryTimes = 1; 63 | $requestUrl = $request->composeUrl($iSigner, $credential, $domain); 64 | 65 | if (count($request->getDomainParameter()) > 0) { 66 | $httpResponse = HttpHelper::curl($requestUrl, $request->getDomainParameter(), $request->getHeaders()); 67 | } else { 68 | $httpResponse = HttpHelper::curl($requestUrl, $request->getMethod(), $request->getContent(), $request->getHeaders()); 69 | } 70 | $retryTimes++; 71 | } 72 | 73 | return $httpResponse; 74 | } 75 | 76 | public function doAction($request, $iSigner = null, $credential = null, $autoRetry = true, $maxRetryNumber = 3) 77 | { 78 | trigger_error('doAction() is deprecated. Please use getAcsResponse() instead.', E_USER_NOTICE); 79 | 80 | return $this->doActionImpl($request, $iSigner, $credential, $autoRetry, $maxRetryNumber); 81 | } 82 | 83 | private function prepareRequest($request) 84 | { 85 | if ($request->getRegionId() == null) { 86 | $request->setRegionId($this->iClientProfile->getRegionId()); 87 | } 88 | if ($request->getAcceptFormat() == null) { 89 | $request->setAcceptFormat($this->iClientProfile->getFormat()); 90 | } 91 | if ($request->getMethod() == null) { 92 | $request->setMethod('GET'); 93 | } 94 | 95 | return $request; 96 | } 97 | 98 | private function buildApiException($respObject, $httpStatus) 99 | { 100 | throw new ServerException($respObject->Message, $respObject->Code, $httpStatus, $respObject->RequestId); 101 | } 102 | 103 | private function parseAcsResponse($body, $format) 104 | { 105 | if ($format == 'JSON') { 106 | $respObject = json_decode($body); 107 | } elseif ($format == 'XML') { 108 | $respObject = @simplexml_load_string($body); 109 | } elseif ($format == 'RAW') { 110 | $respObject = $body; 111 | } 112 | 113 | return $respObject; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /.php-cs-fixer.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | This source file is subject to the MIT license that is bundled 9 | with this source code in the file LICENSE. 10 | HEADER; 11 | 12 | $finder = PhpCsFixer\Finder::create() 13 | ->in([ 14 | __DIR__ . '/src', 15 | ]) 16 | ->exclude([ 17 | __DIR__ . '/vendor', 18 | ]) 19 | ->name('*.php') 20 | ->notName('*.blade.php') 21 | ->ignoreDotFiles(true) 22 | ->ignoreVCS(true); 23 | 24 | return (new PhpCsFixer\Config()) 25 | ->setRules([ 26 | '@PSR12' => true, 27 | 'array_syntax' => ['syntax' => 'short'], 28 | 'no_useless_else' => true, 29 | 'not_operator_with_successor_space' => true, 30 | 'phpdoc_scalar' => true, 31 | 'unary_operator_spaces' => true, 32 | 'binary_operator_spaces' => true, 33 | 'blank_line_before_statement' => [ 34 | 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], 35 | ], 36 | 'phpdoc_single_line_var_spacing' => true, 37 | 'phpdoc_var_without_name' => true, 38 | 'class_attributes_separation' => [ 39 | 'elements' => [ 40 | 'method' => 'one', 41 | ], 42 | ], 43 | 'method_argument_space' => [ 44 | 'on_multiline' => 'ensure_fully_multiline', 45 | 'keep_multiple_spaces_after_comma' => true, 46 | ], 47 | 'single_trait_insert_per_statement' => true, 48 | 'trim_array_spaces' => true, 49 | 'combine_consecutive_unsets' => true, 50 | 'concat_space' => ['spacing' => 'one'], 51 | 'new_with_braces' => true, 52 | 'no_space_around_double_colon' => true, 53 | 'object_operator_without_whitespace' => true, 54 | 'ternary_operator_spaces' => true, 55 | 'ternary_to_null_coalescing' => true, 56 | 'align_multiline_comment' => true, 57 | 'no_blank_lines_after_phpdoc' => true, 58 | 'no_useless_return' => true, 59 | 'return_assignment' => true, 60 | 'blank_line_after_namespace' => true, 61 | 'no_leading_namespace_whitespace' => true, 62 | 'fully_qualified_strict_types' => true, 63 | 'global_namespace_import' => [ 64 | 'import_classes' => true, 65 | 'import_constants' => true, 66 | 'import_functions' => true 67 | ], 68 | 'group_import' => true, 69 | 'single_import_per_statement' => false, 70 | 'no_unused_imports' => true, 71 | 'ordered_imports' => [ 72 | 'sort_algorithm' => 'length', 73 | 'imports_order' => ['const', 'class', 'function'] 74 | ], 75 | 'single_line_after_imports' => true, 76 | 'blank_line_after_opening_tag' => true, 77 | 'compact_nullable_typehint' => true, 78 | 'declare_equal_normalize' => true, 79 | 'lowercase_cast' => true, 80 | 'lowercase_static_reference' => true, 81 | 'no_blank_lines_after_class_opening' => true, 82 | 'no_leading_import_slash' => true, 83 | 'no_whitespace_in_blank_line' => true, 84 | 'ordered_class_elements' => [ 85 | 'order' => [ 86 | 'use_trait', 87 | ], 88 | ], 89 | 'return_type_declaration' => true, 90 | 'short_scalar_cast' => true, 91 | 'visibility_required' => [ 92 | 'elements' => [ 93 | 'const', 94 | 'method', 95 | 'property', 96 | ], 97 | ], 98 | '@DoctrineAnnotation' => true, 99 | 'header_comment' => [ 100 | 'comment_type' => 'PHPDoc', 101 | 'header' => $header, 102 | 'separate' => 'none', 103 | 'location' => 'after_declare_strict', 104 | ], 105 | 'list_syntax' => [ 106 | 'syntax' => 'short', 107 | ], 108 | 'general_phpdoc_annotation_remove' => [ 109 | 'annotations' => [ 110 | 'author', 111 | ], 112 | ], 113 | 'single_line_comment_style' => [ 114 | 'comment_types' => [ 115 | ], 116 | ], 117 | 'yoda_style' => [ 118 | 'always_move_variable' => false, 119 | 'equal' => false, 120 | 'identical' => false, 121 | ], 122 | 'phpdoc_align' => [ 123 | 'align' => 'left', 124 | ], 125 | 'multiline_whitespace_before_semicolons' => [ 126 | 'strategy' => 'no_multi_line', 127 | ], 128 | 'constant_case' => [ 129 | 'case' => 'lower', 130 | ], 131 | 'linebreak_after_opening_tag' => true, 132 | 'not_operator_with_space' => false, 133 | 'php_unit_strict' => false, 134 | 'phpdoc_separation' => false, 135 | 'single_quote' => true, 136 | 'standardize_not_equals' => true, 137 | 'multiline_comment_opening_closing' => true, 138 | ]) 139 | ->setFinder($finder); 140 | -------------------------------------------------------------------------------- /src/Core/RoaAcsRequest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | abstract class RoaAcsRequest extends AcsRequest 11 | { 12 | protected $uriPattern; 13 | private $pathParameters = []; 14 | private $domainParameters = []; 15 | private $dateTimeFormat = "D, d M Y H:i:s \G\M\T"; 16 | private static $headerSeparator = "\n"; 17 | private static $querySeprator = '&'; 18 | 19 | public function __construct($product, $version, $actionName) 20 | { 21 | parent::__construct($product, $version, $actionName); 22 | $this->setVersion($version); 23 | $this->initialize(); 24 | } 25 | 26 | private function initialize() 27 | { 28 | $this->setMethod('RAW'); 29 | } 30 | 31 | public function composeUrl($iSigner, $credential, $domain) 32 | { 33 | $this->prepareHeader($iSigner); 34 | 35 | $signString = $this->getMethod() . self::$headerSeparator; 36 | if (isset($this->headers['Accept'])) { 37 | $signString = $signString . $this->headers['Accept']; 38 | } 39 | $signString = $signString . self::$headerSeparator; 40 | 41 | if (isset($this->headers['Content-MD5'])) { 42 | $signString = $signString . $this->headers['Content-MD5']; 43 | } 44 | $signString = $signString . self::$headerSeparator; 45 | 46 | if (isset($this->headers['Content-Type'])) { 47 | $signString = $signString . $this->headers['Content-Type']; 48 | } 49 | $signString = $signString . self::$headerSeparator; 50 | 51 | if (isset($this->headers['Date'])) { 52 | $signString = $signString . $this->headers['Date']; 53 | } 54 | $signString = $signString . self::$headerSeparator; 55 | 56 | $uri = $this->replaceOccupiedParameters(); 57 | $signString = $signString . $this->buildCanonicalHeaders(); 58 | $queryString = $this->buildQueryString($uri); 59 | $signString .= $queryString; 60 | $this->headers['Authorization'] = 'acs ' . $credential->getAccessKeyId() . ':' 61 | . $iSigner->signString($signString, $credential->getAccessSecret()); 62 | 63 | return $this->getProtocol() . '://' . $domain . $queryString; 64 | } 65 | 66 | private function prepareHeader($iSigner) 67 | { 68 | date_default_timezone_set('GMT'); 69 | $this->headers['Date'] = date($this->dateTimeFormat); 70 | if ($this->acceptFormat == null) { 71 | $this->acceptFormat = 'RAW'; 72 | } 73 | $this->headers['Accept'] = $this->formatToAccept($this->getAcceptFormat()); 74 | $this->headers['x-acs-signature-method'] = $iSigner->getSignatureMethod(); 75 | $this->headers['x-acs-signature-version'] = $iSigner->getSignatureVersion(); 76 | $this->headers['x-acs-region-id'] = $this->regionId; 77 | $content = $this->getDomainParameter(); 78 | if ($content != null) { 79 | $this->headers['Content-MD5'] = base64_encode(md5(json_encode($content), true)); 80 | } 81 | $this->headers['Content-Type'] = 'application/octet-stream;charset=utf-8'; 82 | } 83 | 84 | private function replaceOccupiedParameters() 85 | { 86 | $result = $this->uriPattern; 87 | foreach ($this->pathParameters as $pathParameterKey => $apiParameterValue) { 88 | $target = '[' . $pathParameterKey . ']'; 89 | $result = str_replace($target, $apiParameterValue, $result); 90 | } 91 | 92 | return $result; 93 | } 94 | 95 | private function buildCanonicalHeaders() 96 | { 97 | $sortMap = []; 98 | foreach ($this->headers as $headerKey => $headerValue) { 99 | $key = strtolower($headerKey); 100 | if (strpos($key, 'x-acs-') === 0) { 101 | $sortMap[$key] = $headerValue; 102 | } 103 | } 104 | ksort($sortMap); 105 | $headerString = ''; 106 | foreach ($sortMap as $sortMapKey => $sortMapValue) { 107 | $headerString = $headerString . $sortMapKey . ':' . $sortMapValue . self::$headerSeparator; 108 | } 109 | 110 | return $headerString; 111 | } 112 | 113 | private function splitSubResource($uri) 114 | { 115 | $queIndex = strpos($uri, '?'); 116 | $uriParts = []; 117 | if ($queIndex != null) { 118 | array_push($uriParts, substr($uri, 0, $queIndex)); 119 | array_push($uriParts, substr($uri, $queIndex + 1)); 120 | } else { 121 | array_push($uriParts, $uri); 122 | } 123 | 124 | return $uriParts; 125 | } 126 | 127 | private function buildQueryString($uri) 128 | { 129 | $uriParts = $this->splitSubResource($uri); 130 | $sortMap = $this->queryParameters; 131 | if (isset($uriParts[1])) { 132 | $sortMap[$uriParts[1]] = null; 133 | } 134 | $queryString = $uriParts[0]; 135 | if (count($uriParts)) { 136 | $queryString = $queryString . '?'; 137 | } 138 | ksort($sortMap); 139 | foreach ($sortMap as $sortMapKey => $sortMapValue) { 140 | $queryString = $queryString . $sortMapKey; 141 | if (isset($sortMapValue)) { 142 | $queryString = $queryString . '=' . $sortMapValue; 143 | } 144 | $queryString = $queryString . $querySeprator; 145 | } 146 | if (count($sortMap) == null) { 147 | $queryString = substr($queryString, 0, strlen($queryString) - 1); 148 | } 149 | 150 | return $queryString; 151 | } 152 | 153 | private function formatToAccept($acceptFormat) 154 | { 155 | if ($acceptFormat == 'JSON') { 156 | return 'application/json'; 157 | } elseif ($acceptFormat == 'XML') { 158 | return 'application/xml'; 159 | } 160 | 161 | return 'application/octet-stream'; 162 | } 163 | 164 | public function getPathParameters() 165 | { 166 | return $this->pathParameters; 167 | } 168 | 169 | public function putPathParameter($name, $value) 170 | { 171 | $this->pathParameters[$name] = $value; 172 | } 173 | 174 | public function getDomainParameter() 175 | { 176 | return $this->domainParameters; 177 | } 178 | 179 | public function putDomainParameters($name, $value) 180 | { 181 | $this->domainParameters[$name] = $value; 182 | } 183 | 184 | public function getUriPattern() 185 | { 186 | return $this->uriPattern; 187 | } 188 | 189 | public function setUriPattern($uriPattern) 190 | { 191 | return $this->uriPattern = $uriPattern; 192 | } 193 | 194 | public function setVersion($version) 195 | { 196 | $this->version = $version; 197 | $this->headers['x-acs-version'] = $version; 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /src/AliGreen.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * This source file is subject to the MIT license that is bundled 8 | * with this source code in the file LICENSE. 9 | */ 10 | 11 | namespace James\AliGreen; 12 | 13 | use DefaultProfile; 14 | use DefaultAcsClient; 15 | use Illuminate\Support\{Arr, Str}; 16 | use James\AliGreen\Green\{ImageSyncScanRequest, TextScanRequest}; 17 | 18 | include_once 'Core/Config.php'; 19 | 20 | class AliGreen 21 | { 22 | private static $_instance; 23 | 24 | private function __clone() 25 | { 26 | trigger_error('clone is not allowed', E_USER_ERROR); 27 | } 28 | 29 | /** 30 | * Get the acs client 31 | * @return DefaultAcsClient 32 | */ 33 | public static function getClient() 34 | { 35 | date_default_timezone_set('PRC'); 36 | 37 | $iClientProfile = DefaultProfile::getProfile(config('aliyun.region'), config('aliyun.accessKeyId'), config('aliyun.accessKeySecret')); 38 | DefaultProfile::addEndpoint(config('aliyun.region'), config('aliyun.region'), 'Green', 'green.' . config('aliyun.region') . '.aliyuncs.com'); 39 | 40 | return new DefaultAcsClient($iClientProfile); 41 | } 42 | 43 | /** 44 | * create the singleton 45 | * @return AliGreenAPI 46 | */ 47 | public static function getInstance() 48 | { 49 | if (empty(self::$_instance)) { 50 | $class = get_called_class(); 51 | self::$_instance = new $class(); 52 | } 53 | 54 | return self::$_instance; 55 | } 56 | 57 | /** 58 | * scene 风险场景,和传递进来的场景对应 59 | * suggestion 建议用户处理,取值范围:[“pass”, “review”, “block”], pass:图片正常,review:需要人工审核,block:图片违规, 60 | * 可以直接删除或者做限制处理 61 | * label 文本的分类 62 | * rate 浮点数,结果为该分类的概率;值越高,越趋于该分类;取值为[0.00-100.00] 63 | * extras map,可选,附加信息. 该值将来可能会调整,建议不要在业务上进行依赖 64 | * 65 | * @param $request 66 | */ 67 | private function processResponse($request, $title, $type) 68 | { 69 | $client = $this->getClient(); 70 | $response = $client->getAcsResponse($request); 71 | 72 | if ($response->code == 200) { 73 | if (! $taskResults = $response->data) { 74 | return $this->response(-200, '请重试!'); 75 | } 76 | 77 | $arr = $this->processSceneResult($taskResults, $title, $type); 78 | 79 | if (! $arr) { 80 | return $this->response(200, [ 81 | 'rate' => 100, 82 | 'describe' => '正常' 83 | ]); 84 | } 85 | 86 | return $this->response(-100, $arr); 87 | } 88 | 89 | return $this->response(-200, '请重试!'); 90 | } 91 | 92 | /** 93 | * Date: 2020/2/8 18:33 94 | * @param $taskResults 95 | * @param $title 96 | * @param $type 97 | * @return mixed 98 | */ 99 | private function processSceneResult($taskResults, $title, $type) 100 | { 101 | $arr = []; 102 | foreach ($taskResults as $value) { 103 | foreach ($value->results as $v) { 104 | $arr[] = $this->review($v->suggestion, $v->label, $v->rate, $v->scene); 105 | } 106 | } 107 | 108 | // 处理自定文字 109 | if (! array_filter($arr) && config('aliyun.content') && $type == 'text') { 110 | $title = Arr::wrap($title); 111 | 112 | foreach ($title as $v) { 113 | $arr[] = $this->reviewText($v); 114 | } 115 | } 116 | 117 | return current(array_filter($arr)); 118 | } 119 | 120 | /** 121 | * Notes: 格式化数据 122 | * Date: 2019/8/12 17:40 123 | * @param $suggestion 124 | * @param $label 125 | * @param $rate 126 | * @return array 127 | */ 128 | private function review($suggestion, $label, $rate, $scene) 129 | { 130 | $arr = []; 131 | if (in_array($suggestion, ['review', 'block'])) { 132 | $arr = [ 133 | 'label' => $label, 134 | 'rate' => $rate, 135 | 'scene' => $scene, 136 | 'describe' => $suggestion == 'review' ? '疑似' : '违规', 137 | ]; 138 | } 139 | 140 | return $arr; 141 | } 142 | 143 | /** 144 | * Notes: 检测是否包含自定义文字 145 | * Date: 2019/8/12 17:45 146 | * @param $title 147 | * @return array 148 | */ 149 | private function reviewText($title) 150 | { 151 | return Str::contains($title, config('aliyun.content')) ? ['rate' => 100, 'describe' => '违规'] : []; 152 | } 153 | 154 | /** 155 | * 文本垃圾检测 156 | * scenes字符串数组: 157 | * 关键词识别scene场景取值keyword 158 | * 分类label:正常normal 含垃圾信息spam 含广告ad 涉政politics 暴恐terrorism 色情porn 辱骂abuse 159 | * 灌水flood 命中自定义customized(阿里后台自定义) 160 | * 垃圾检测识别场景scene取值antispam 161 | * 分类label:正常normal 含违规信息spam 含广告ad 涉政politics 暴恐terrorism 色情porn 违禁contraband 162 | * 命中自定义customized(阿里后台自定义) 163 | * 164 | * tasks json数组 ,最多支持100个task即100段文本 165 | * content 待检测文本,最长4000个字符 166 | * 167 | * @param $text 支持字符串和数组 168 | * @return null 169 | */ 170 | public function checkText($text) 171 | { 172 | if (empty($text)) { 173 | return null; 174 | } 175 | 176 | $request = new TextScanRequest(); 177 | $request->setMethod('POST'); 178 | $request->setAcceptFormat('JSON'); 179 | 180 | if (is_array($text)) { 181 | $taskArr = []; 182 | foreach ($text as $k => $v) { 183 | $task = 'task' . $k; 184 | $$task = ['dataId' => md5(uniqid($task)), 185 | 'content' => $v, 186 | 'category' => 'post', 187 | 'time' => round(microtime(true) * 1000) 188 | ]; 189 | array_push($taskArr, $$task); 190 | } 191 | $request->setContent(json_encode(['tasks' => $taskArr, 'scenes' => ['antispam']])); 192 | } elseif (is_string($text)) { 193 | $task1 = ['dataId' => md5(uniqid()), 194 | 'content' => $text 195 | ]; 196 | $request->setContent(json_encode(['tasks' => [$task1], 'scenes' => ['antispam']])); 197 | } 198 | 199 | return $this->processResponse($request, $text, 'text'); 200 | } 201 | 202 | /** 203 | * 图片检测 204 | * scenes字符串数组: 205 | * 图片广告识别scene场景取值ad 206 | * 分类label: 正常normal 含广告ad 207 | * 图片鉴黄识别场景scene取值porn 208 | * 分类label:正常normal 性感sexy 色情porn 209 | * 图片暴恐涉政识别场景scene取值terrorism 210 | * 分类label:正常normal terrorism含暴恐图片 outfit特殊装束 logo特殊标识 weapon武器 politics渉政 others 其它暴恐渉政 211 | * 212 | * tasks json数组 ,最多支持100个task即100张图片 213 | * 214 | * @param $img 支持字符串和数组 215 | * @return null 216 | */ 217 | public function checkImg($img) 218 | { 219 | if (empty($img)) { 220 | return null; 221 | } 222 | 223 | $request = new ImageSyncScanRequest(); 224 | $request->setMethod('POST'); 225 | $request->setAcceptFormat('JSON'); 226 | 227 | if (is_array($img)) { 228 | $taskArr = []; 229 | foreach ($img as $k => $v) { 230 | $task = 'task' . $k; 231 | $$task = ['dataId' => md5(uniqid($task)), 232 | 'url' => $v, 233 | 'time' => round(microtime(true) * 1000) 234 | ]; 235 | array_push($taskArr, $$task); 236 | } 237 | $request->setContent(json_encode(['tasks' => $taskArr, 'scenes' => config('aliyun.scenes')])); 238 | } elseif (is_string($img)) { 239 | $task1 = ['dataId' => md5(uniqid()), 240 | 'url' => $img, 241 | 'time' => round(microtime(true) * 1000) 242 | ]; 243 | $request->setContent(json_encode(['tasks' => [$task1], 'scenes' => config('aliyun.scenes')])); 244 | } 245 | 246 | return $this->processResponse($request, $img, 'image'); 247 | } 248 | 249 | /** 250 | * @param $code 251 | * @param $msg 252 | */ 253 | private function response($code, $msg) 254 | { 255 | return [ 256 | 'code' => $code, 257 | 'msg' => $msg, 258 | ]; 259 | } 260 | } 261 | -------------------------------------------------------------------------------- /src/Core/Regions/endpoints.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jp-fudao-1 5 | 6 | Ecsecs-cn-hangzhou.aliyuncs.com 7 | 8 | 9 | 10 | me-east-1 11 | 12 | Rdsrds.me-east-1.aliyuncs.com 13 | Ecsecs.me-east-1.aliyuncs.com 14 | Vpcvpc.me-east-1.aliyuncs.com 15 | Kmskms.me-east-1.aliyuncs.com 16 | Cmsmetrics.cn-hangzhou.aliyuncs.com 17 | Slbslb.me-east-1.aliyuncs.com 18 | 19 | 20 | 21 | us-east-1 22 | 23 | CScs.aliyuncs.com 24 | Pushcloudpush.aliyuncs.com 25 | COScos.aliyuncs.com 26 | Essess.aliyuncs.com 27 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 28 | Billingbilling.aliyuncs.com 29 | Dqsdqs.aliyuncs.com 30 | Ddsmongodb.aliyuncs.com 31 | Emremr.aliyuncs.com 32 | Smssms.aliyuncs.com 33 | Jaqjaq.aliyuncs.com 34 | HPChpc.aliyuncs.com 35 | Locationlocation.aliyuncs.com 36 | ChargingServicechargingservice.aliyuncs.com 37 | Msgmsg-inner.aliyuncs.com 38 | Commondrivercommon.driver.aliyuncs.com 39 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 40 | Bssbss.aliyuncs.com 41 | Workorderworkorder.aliyuncs.com 42 | Ocsm-kvstore.aliyuncs.com 43 | Yundunyundun-cn-hangzhou.aliyuncs.com 44 | Ubsms-innerubsms-inner.aliyuncs.com 45 | Dmdm.aliyuncs.com 46 | Greengreen.aliyuncs.com 47 | Riskrisk-cn-hangzhou.aliyuncs.com 48 | oceanbaseoceanbase.aliyuncs.com 49 | Mscmsc-inner.aliyuncs.com 50 | Yundunhsmyundunhsm.aliyuncs.com 51 | Iotiot.aliyuncs.com 52 | jaqjaq.aliyuncs.com 53 | Omsoms.aliyuncs.com 54 | livelive.aliyuncs.com 55 | Ecsecs-cn-hangzhou.aliyuncs.com 56 | Ubsmsubsms.aliyuncs.com 57 | Vpcvpc.aliyuncs.com 58 | Alertalert.aliyuncs.com 59 | Aceace.cn-hangzhou.aliyuncs.com 60 | AMSams.aliyuncs.com 61 | ROSros.aliyuncs.com 62 | PTSpts.aliyuncs.com 63 | Qualitycheckqualitycheck.aliyuncs.com 64 | M-kvstorem-kvstore.aliyuncs.com 65 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 66 | CmsSiteMonitorsitemonitor.aliyuncs.com 67 | Rdsrds.aliyuncs.com 68 | BatchComputebatchCompute.aliyuncs.com 69 | CFcf.aliyuncs.com 70 | Drdsdrds.aliyuncs.com 71 | Acsacs.aliyun-inc.com 72 | Httpdnshttpdns-api.aliyuncs.com 73 | Location-innerlocation-inner.aliyuncs.com 74 | Aasaas.aliyuncs.com 75 | Stssts.aliyuncs.com 76 | Dtsdts.aliyuncs.com 77 | Drcdrc.aliyuncs.com 78 | Vpc-innervpc-inner.aliyuncs.com 79 | Cmsmetrics.cn-hangzhou.aliyuncs.com 80 | Slbslb.aliyuncs.com 81 | Crmcrm-cn-hangzhou.aliyuncs.com 82 | Domaindomain.aliyuncs.com 83 | Otsots-pop.aliyuncs.com 84 | Ossoss-cn-hangzhou.aliyuncs.com 85 | Ramram.aliyuncs.com 86 | Salessales.cn-hangzhou.aliyuncs.com 87 | OssAdminoss-admin.aliyuncs.com 88 | Alidnsalidns.aliyuncs.com 89 | Onsons.aliyuncs.com 90 | Cdncdn.aliyuncs.com 91 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 92 | 93 | 94 | 95 | ap-northeast-1 96 | 97 | Rdsrds.ap-northeast-1.aliyuncs.com 98 | Kmskms.ap-northeast-1.aliyuncs.com 99 | Vpcvpc.ap-northeast-1.aliyuncs.com 100 | Ecsecs.ap-northeast-1.aliyuncs.com 101 | Cmsmetrics.ap-northeast-1.aliyuncs.com 102 | Kvstorer-kvstore.ap-northeast-1.aliyuncs.com 103 | Slbslb.ap-northeast-1.aliyuncs.com 104 | 105 | 106 | 107 | cn-hangzhou-bj-b01 108 | 109 | Ecsecs-cn-hangzhou.aliyuncs.com 110 | 111 | 112 | 113 | cn-hongkong 114 | 115 | Pushcloudpush.aliyuncs.com 116 | COScos.aliyuncs.com 117 | Onsons.aliyuncs.com 118 | Essess.aliyuncs.com 119 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 120 | Billingbilling.aliyuncs.com 121 | Dqsdqs.aliyuncs.com 122 | Ddsmongodb.aliyuncs.com 123 | Emremr.aliyuncs.com 124 | Smssms.aliyuncs.com 125 | Jaqjaq.aliyuncs.com 126 | CScs.aliyuncs.com 127 | Kmskms.cn-hongkong.aliyuncs.com 128 | Locationlocation.aliyuncs.com 129 | Msgmsg-inner.aliyuncs.com 130 | ChargingServicechargingservice.aliyuncs.com 131 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 132 | Alertalert.aliyuncs.com 133 | Mscmsc-inner.aliyuncs.com 134 | Drcdrc.aliyuncs.com 135 | Yundunyundun-cn-hangzhou.aliyuncs.com 136 | Ubsms-innerubsms-inner.aliyuncs.com 137 | Ocsm-kvstore.aliyuncs.com 138 | Dmdm.aliyuncs.com 139 | Riskrisk-cn-hangzhou.aliyuncs.com 140 | oceanbaseoceanbase.aliyuncs.com 141 | Workorderworkorder.aliyuncs.com 142 | Yundunhsmyundunhsm.aliyuncs.com 143 | Iotiot.aliyuncs.com 144 | HPChpc.aliyuncs.com 145 | jaqjaq.aliyuncs.com 146 | Omsoms.aliyuncs.com 147 | livelive.aliyuncs.com 148 | Ecsecs-cn-hangzhou.aliyuncs.com 149 | M-kvstorem-kvstore.aliyuncs.com 150 | Vpcvpc.aliyuncs.com 151 | BatchComputebatchCompute.aliyuncs.com 152 | AMSams.aliyuncs.com 153 | ROSros.aliyuncs.com 154 | PTSpts.aliyuncs.com 155 | Qualitycheckqualitycheck.aliyuncs.com 156 | Bssbss.aliyuncs.com 157 | Ubsmsubsms.aliyuncs.com 158 | CloudAPIapigateway.cn-hongkong.aliyuncs.com 159 | Stssts.aliyuncs.com 160 | CmsSiteMonitorsitemonitor.aliyuncs.com 161 | Aceace.cn-hangzhou.aliyuncs.com 162 | Mtsmts.cn-hongkong.aliyuncs.com 163 | Location-innerlocation-inner.aliyuncs.com 164 | CFcf.aliyuncs.com 165 | Acsacs.aliyun-inc.com 166 | Httpdnshttpdns-api.aliyuncs.com 167 | Greengreen.aliyuncs.com 168 | Aasaas.aliyuncs.com 169 | Alidnsalidns.aliyuncs.com 170 | Dtsdts.aliyuncs.com 171 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 172 | Vpc-innervpc-inner.aliyuncs.com 173 | Cmsmetrics.cn-hangzhou.aliyuncs.com 174 | Slbslb.aliyuncs.com 175 | Commondrivercommon.driver.aliyuncs.com 176 | Domaindomain.aliyuncs.com 177 | Otsots-pop.aliyuncs.com 178 | Cdncdn.aliyuncs.com 179 | Ramram.aliyuncs.com 180 | Drdsdrds.aliyuncs.com 181 | Rdsrds.aliyuncs.com 182 | Crmcrm-cn-hangzhou.aliyuncs.com 183 | OssAdminoss-admin.aliyuncs.com 184 | Salessales.cn-hangzhou.aliyuncs.com 185 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 186 | Ossoss-cn-hongkong.aliyuncs.com 187 | 188 | 189 | 190 | cn-beijing-nu16-b01 191 | 192 | Ecsecs-cn-hangzhou.aliyuncs.com 193 | 194 | 195 | 196 | cn-beijing-am13-c01 197 | 198 | Ecsecs-cn-hangzhou.aliyuncs.com 199 | Vpcvpc.aliyuncs.com 200 | 201 | 202 | 203 | in-west-antgroup-1 204 | 205 | Ecsecs-cn-hangzhou.aliyuncs.com 206 | 207 | 208 | 209 | cn-guizhou-gov 210 | 211 | Ecsecs-cn-hangzhou.aliyuncs.com 212 | Vpcvpc.aliyuncs.com 213 | 214 | 215 | 216 | in-west-antgroup-2 217 | 218 | Ecsecs-cn-hangzhou.aliyuncs.com 219 | 220 | 221 | 222 | cn-qingdao-cm9 223 | 224 | CScs.aliyuncs.com 225 | Riskrisk-cn-hangzhou.aliyuncs.com 226 | COScos.aliyuncs.com 227 | Essess.aliyuncs.com 228 | Billingbilling.aliyuncs.com 229 | Dqsdqs.aliyuncs.com 230 | Ddsmongodb.aliyuncs.com 231 | Alidnsalidns.aliyuncs.com 232 | Smssms.aliyuncs.com 233 | Drdsdrds.aliyuncs.com 234 | HPChpc.aliyuncs.com 235 | Locationlocation.aliyuncs.com 236 | Msgmsg-inner.aliyuncs.com 237 | ChargingServicechargingservice.aliyuncs.com 238 | Ocsm-kvstore.aliyuncs.com 239 | Alertalert.aliyuncs.com 240 | Mscmsc-inner.aliyuncs.com 241 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 242 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 243 | Yundunyundun-cn-hangzhou.aliyuncs.com 244 | Ubsms-innerubsms-inner.aliyuncs.com 245 | Dmdm.aliyuncs.com 246 | Greengreen.aliyuncs.com 247 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 248 | oceanbaseoceanbase.aliyuncs.com 249 | Workorderworkorder.aliyuncs.com 250 | Yundunhsmyundunhsm.aliyuncs.com 251 | Iotiot.aliyuncs.com 252 | jaqjaq.aliyuncs.com 253 | Omsoms.aliyuncs.com 254 | livelive.aliyuncs.com 255 | Ecsecs-cn-hangzhou.aliyuncs.com 256 | Ubsmsubsms.aliyuncs.com 257 | CmsSiteMonitorsitemonitor.aliyuncs.com 258 | AMSams.aliyuncs.com 259 | Crmcrm-cn-hangzhou.aliyuncs.com 260 | PTSpts.aliyuncs.com 261 | Qualitycheckqualitycheck.aliyuncs.com 262 | Bssbss.aliyuncs.com 263 | M-kvstorem-kvstore.aliyuncs.com 264 | Aceace.cn-hangzhou.aliyuncs.com 265 | Mtsmts.cn-qingdao.aliyuncs.com 266 | CFcf.aliyuncs.com 267 | Httpdnshttpdns-api.aliyuncs.com 268 | Location-innerlocation-inner.aliyuncs.com 269 | Aasaas.aliyuncs.com 270 | Stssts.aliyuncs.com 271 | Dtsdts.aliyuncs.com 272 | Emremr.aliyuncs.com 273 | Drcdrc.aliyuncs.com 274 | Pushcloudpush.aliyuncs.com 275 | Cmsmetrics.aliyuncs.com 276 | Slbslb.aliyuncs.com 277 | Commondrivercommon.driver.aliyuncs.com 278 | Domaindomain.aliyuncs.com 279 | Otsots-pop.aliyuncs.com 280 | ROSros.aliyuncs.com 281 | Ossoss-cn-hangzhou.aliyuncs.com 282 | Ramram.aliyuncs.com 283 | Salessales.cn-hangzhou.aliyuncs.com 284 | Rdsrds.aliyuncs.com 285 | OssAdminoss-admin.aliyuncs.com 286 | Onsons.aliyuncs.com 287 | Cdncdn.aliyuncs.com 288 | 289 | 290 | 291 | tw-snowcloud-kaohsiung 292 | 293 | Ecsecs-cn-hangzhou.aliyuncs.com 294 | 295 | 296 | 297 | cn-shanghai-finance-1 298 | 299 | Kmskms.cn-shanghai-finance-1.aliyuncs.com 300 | Ecsecs-cn-hangzhou.aliyuncs.com 301 | Vpcvpc.aliyuncs.com 302 | Rdsrds.aliyuncs.com 303 | 304 | 305 | 306 | cn-guizhou 307 | 308 | Ecsecs-cn-hangzhou.aliyuncs.com 309 | Vpcvpc.aliyuncs.com 310 | 311 | 312 | 313 | cn-qingdao-finance 314 | 315 | Ossoss-cn-qdjbp-a.aliyuncs.com 316 | 317 | 318 | 319 | cn-beijing-gov-1 320 | 321 | Ossoss-cn-haidian-a.aliyuncs.com 322 | Rdsrds.aliyuncs.com 323 | 324 | 325 | 326 | cn-shanghai 327 | 328 | ARMSarms.cn-shanghai.aliyuncs.com 329 | Riskrisk-cn-hangzhou.aliyuncs.com 330 | COScos.aliyuncs.com 331 | HPChpc.aliyuncs.com 332 | Billingbilling.aliyuncs.com 333 | Dqsdqs.aliyuncs.com 334 | Drcdrc.aliyuncs.com 335 | Alidnsalidns.aliyuncs.com 336 | Smssms.aliyuncs.com 337 | Drdsdrds.aliyuncs.com 338 | CScs.aliyuncs.com 339 | Kmskms.cn-shanghai.aliyuncs.com 340 | Locationlocation.aliyuncs.com 341 | Msgmsg-inner.aliyuncs.com 342 | ChargingServicechargingservice.aliyuncs.com 343 | Ocsm-kvstore.aliyuncs.com 344 | Alertalert.aliyuncs.com 345 | Mscmsc-inner.aliyuncs.com 346 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 347 | Yundunyundun-cn-hangzhou.aliyuncs.com 348 | Ubsms-innerubsms-inner.aliyuncs.com 349 | Dmdm.aliyuncs.com 350 | Greengreen.cn-shanghai.aliyuncs.com 351 | Commondrivercommon.driver.aliyuncs.com 352 | oceanbaseoceanbase.aliyuncs.com 353 | Workorderworkorder.aliyuncs.com 354 | Yundunhsmyundunhsm.aliyuncs.com 355 | Iotiot.aliyuncs.com 356 | Bssbss.aliyuncs.com 357 | Omsoms.aliyuncs.com 358 | Ubsmsubsms.aliyuncs.com 359 | livelive.aliyuncs.com 360 | Ecsecs-cn-hangzhou.aliyuncs.com 361 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 362 | CmsSiteMonitorsitemonitor.aliyuncs.com 363 | BatchComputebatchCompute.aliyuncs.com 364 | AMSams.aliyuncs.com 365 | ROSros.aliyuncs.com 366 | PTSpts.aliyuncs.com 367 | Qualitycheckqualitycheck.aliyuncs.com 368 | M-kvstorem-kvstore.aliyuncs.com 369 | Apigatewayapigateway.cn-shanghai.aliyuncs.com 370 | CloudAPIapigateway.cn-shanghai.aliyuncs.com 371 | Stssts.aliyuncs.com 372 | Vpcvpc.aliyuncs.com 373 | Aceace.cn-hangzhou.aliyuncs.com 374 | Mtsmts.cn-shanghai.aliyuncs.com 375 | Ddsmongodb.aliyuncs.com 376 | CFcf.aliyuncs.com 377 | Acsacs.aliyun-inc.com 378 | Httpdnshttpdns-api.aliyuncs.com 379 | Pushcloudpush.aliyuncs.com 380 | Location-innerlocation-inner.aliyuncs.com 381 | Aasaas.aliyuncs.com 382 | Emremr.aliyuncs.com 383 | Dtsdts.aliyuncs.com 384 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 385 | Jaqjaq.aliyuncs.com 386 | Cmsmetrics.cn-hangzhou.aliyuncs.com 387 | Slbslb.aliyuncs.com 388 | Crmcrm-cn-hangzhou.aliyuncs.com 389 | Domaindomain.aliyuncs.com 390 | Otsots-pop.aliyuncs.com 391 | jaqjaq.aliyuncs.com 392 | Cdncdn.aliyuncs.com 393 | Ramram.aliyuncs.com 394 | Salessales.cn-hangzhou.aliyuncs.com 395 | Vpc-innervpc-inner.aliyuncs.com 396 | Rdsrds.aliyuncs.com 397 | OssAdminoss-admin.aliyuncs.com 398 | Onsons.aliyuncs.com 399 | Essess.aliyuncs.com 400 | Ossoss-cn-shanghai.aliyuncs.com 401 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 402 | vodvod.cn-shanghai.aliyuncs.com 403 | 404 | 405 | 406 | cn-shenzhen-inner 407 | 408 | Riskrisk-cn-hangzhou.aliyuncs.com 409 | COScos.aliyuncs.com 410 | Onsons.aliyuncs.com 411 | Essess.aliyuncs.com 412 | Billingbilling.aliyuncs.com 413 | Dqsdqs.aliyuncs.com 414 | Ddsmongodb.aliyuncs.com 415 | Alidnsalidns.aliyuncs.com 416 | Smssms.aliyuncs.com 417 | Salessales.cn-hangzhou.aliyuncs.com 418 | HPChpc.aliyuncs.com 419 | Locationlocation.aliyuncs.com 420 | Msgmsg-inner.aliyuncs.com 421 | ChargingServicechargingservice.aliyuncs.com 422 | Ocsm-kvstore.aliyuncs.com 423 | jaqjaq.aliyuncs.com 424 | Mscmsc-inner.aliyuncs.com 425 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 426 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 427 | Bssbss.aliyuncs.com 428 | Ubsms-innerubsms-inner.aliyuncs.com 429 | Dmdm.aliyuncs.com 430 | Commondrivercommon.driver.aliyuncs.com 431 | oceanbaseoceanbase.aliyuncs.com 432 | Workorderworkorder.aliyuncs.com 433 | Yundunhsmyundunhsm.aliyuncs.com 434 | Iotiot.aliyuncs.com 435 | Alertalert.aliyuncs.com 436 | Omsoms.aliyuncs.com 437 | livelive.aliyuncs.com 438 | Ecsecs-cn-hangzhou.aliyuncs.com 439 | Ubsmsubsms.aliyuncs.com 440 | CmsSiteMonitorsitemonitor.aliyuncs.com 441 | AMSams.aliyuncs.com 442 | Crmcrm-cn-hangzhou.aliyuncs.com 443 | PTSpts.aliyuncs.com 444 | Qualitycheckqualitycheck.aliyuncs.com 445 | M-kvstorem-kvstore.aliyuncs.com 446 | Stssts.aliyuncs.com 447 | Aceace.cn-hangzhou.aliyuncs.com 448 | Mtsmts.cn-shenzhen.aliyuncs.com 449 | CFcf.aliyuncs.com 450 | Httpdnshttpdns-api.aliyuncs.com 451 | Greengreen.aliyuncs.com 452 | Aasaas.aliyuncs.com 453 | Emremr.aliyuncs.com 454 | CScs.aliyuncs.com 455 | Drcdrc.aliyuncs.com 456 | Pushcloudpush.aliyuncs.com 457 | Cmsmetrics.aliyuncs.com 458 | Slbslb.aliyuncs.com 459 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 460 | Dtsdts.aliyuncs.com 461 | Domaindomain.aliyuncs.com 462 | Otsots-pop.aliyuncs.com 463 | ROSros.aliyuncs.com 464 | Cdncdn.aliyuncs.com 465 | Ramram.aliyuncs.com 466 | Drdsdrds.aliyuncs.com 467 | Rdsrds.aliyuncs.com 468 | OssAdminoss-admin.aliyuncs.com 469 | Location-innerlocation-inner.aliyuncs.com 470 | Yundunyundun-cn-hangzhou.aliyuncs.com 471 | Ossoss-cn-hangzhou.aliyuncs.com 472 | 473 | 474 | 475 | cn-fujian 476 | 477 | Ecsecs-cn-hangzhou.aliyuncs.com 478 | Rdsrds.aliyuncs.com 479 | 480 | 481 | 482 | in-mumbai-alipay 483 | 484 | Ecsecs-cn-hangzhou.aliyuncs.com 485 | 486 | 487 | 488 | us-west-1 489 | 490 | CScs.aliyuncs.com 491 | COScos.aliyuncs.com 492 | Essess.aliyuncs.com 493 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 494 | Billingbilling.aliyuncs.com 495 | Dqsdqs.aliyuncs.com 496 | Ddsmongodb.aliyuncs.com 497 | Stssts.aliyuncs.com 498 | Smssms.aliyuncs.com 499 | Jaqjaq.aliyuncs.com 500 | Pushcloudpush.aliyuncs.com 501 | Alidnsalidns.aliyuncs.com 502 | Locationlocation.aliyuncs.com 503 | Msgmsg-inner.aliyuncs.com 504 | ChargingServicechargingservice.aliyuncs.com 505 | Ocsm-kvstore.aliyuncs.com 506 | Bssbss.aliyuncs.com 507 | Mscmsc-inner.aliyuncs.com 508 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 509 | Yundunyundun-cn-hangzhou.aliyuncs.com 510 | Ubsms-innerubsms-inner.aliyuncs.com 511 | Dmdm.aliyuncs.com 512 | Greengreen.aliyuncs.com 513 | Riskrisk-cn-hangzhou.aliyuncs.com 514 | oceanbaseoceanbase.aliyuncs.com 515 | Workorderworkorder.aliyuncs.com 516 | Yundunhsmyundunhsm.aliyuncs.com 517 | Iotiot.aliyuncs.com 518 | Alertalert.aliyuncs.com 519 | Omsoms.aliyuncs.com 520 | livelive.aliyuncs.com 521 | Ecsecs-cn-hangzhou.aliyuncs.com 522 | M-kvstorem-kvstore.aliyuncs.com 523 | Vpcvpc.aliyuncs.com 524 | BatchComputebatchCompute.aliyuncs.com 525 | Aceace.cn-hangzhou.aliyuncs.com 526 | AMSams.aliyuncs.com 527 | ROSros.aliyuncs.com 528 | PTSpts.aliyuncs.com 529 | Qualitycheckqualitycheck.aliyuncs.com 530 | Ubsmsubsms.aliyuncs.com 531 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 532 | CmsSiteMonitorsitemonitor.aliyuncs.com 533 | Rdsrds.aliyuncs.com 534 | Mtsmts.us-west-1.aliyuncs.com 535 | CFcf.aliyuncs.com 536 | Acsacs.aliyun-inc.com 537 | Httpdnshttpdns-api.aliyuncs.com 538 | Location-innerlocation-inner.aliyuncs.com 539 | Aasaas.aliyuncs.com 540 | Emremr.aliyuncs.com 541 | HPChpc.aliyuncs.com 542 | Drcdrc.aliyuncs.com 543 | Vpc-innervpc-inner.aliyuncs.com 544 | Cmsmetrics.cn-hangzhou.aliyuncs.com 545 | Slbslb.aliyuncs.com 546 | Crmcrm-cn-hangzhou.aliyuncs.com 547 | Dtsdts.aliyuncs.com 548 | Domaindomain.aliyuncs.com 549 | Otsots-pop.aliyuncs.com 550 | Commondrivercommon.driver.aliyuncs.com 551 | jaqjaq.aliyuncs.com 552 | Cdncdn.aliyuncs.com 553 | Ramram.aliyuncs.com 554 | Drdsdrds.aliyuncs.com 555 | OssAdminoss-admin.aliyuncs.com 556 | Salessales.cn-hangzhou.aliyuncs.com 557 | Onsons.aliyuncs.com 558 | Ossoss-us-west-1.aliyuncs.com 559 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 560 | 561 | 562 | 563 | cn-shanghai-inner 564 | 565 | CScs.aliyuncs.com 566 | COScos.aliyuncs.com 567 | Essess.aliyuncs.com 568 | Billingbilling.aliyuncs.com 569 | Dqsdqs.aliyuncs.com 570 | Ddsmongodb.aliyuncs.com 571 | Emremr.aliyuncs.com 572 | Smssms.aliyuncs.com 573 | Drdsdrds.aliyuncs.com 574 | HPChpc.aliyuncs.com 575 | Locationlocation.aliyuncs.com 576 | ChargingServicechargingservice.aliyuncs.com 577 | Msgmsg-inner.aliyuncs.com 578 | Commondrivercommon.driver.aliyuncs.com 579 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 580 | jaqjaq.aliyuncs.com 581 | Mscmsc-inner.aliyuncs.com 582 | Ocsm-kvstore.aliyuncs.com 583 | Yundunyundun-cn-hangzhou.aliyuncs.com 584 | Ubsms-innerubsms-inner.aliyuncs.com 585 | Dmdm.aliyuncs.com 586 | Greengreen.aliyuncs.com 587 | Riskrisk-cn-hangzhou.aliyuncs.com 588 | oceanbaseoceanbase.aliyuncs.com 589 | Workorderworkorder.aliyuncs.com 590 | Yundunhsmyundunhsm.aliyuncs.com 591 | Iotiot.aliyuncs.com 592 | Bssbss.aliyuncs.com 593 | Omsoms.aliyuncs.com 594 | livelive.aliyuncs.com 595 | Ecsecs-cn-hangzhou.aliyuncs.com 596 | M-kvstorem-kvstore.aliyuncs.com 597 | CmsSiteMonitorsitemonitor.aliyuncs.com 598 | Alertalert.aliyuncs.com 599 | Aceace.cn-hangzhou.aliyuncs.com 600 | AMSams.aliyuncs.com 601 | ROSros.aliyuncs.com 602 | PTSpts.aliyuncs.com 603 | Qualitycheckqualitycheck.aliyuncs.com 604 | Ubsmsubsms.aliyuncs.com 605 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 606 | Rdsrds.aliyuncs.com 607 | Mtsmts.cn-shanghai.aliyuncs.com 608 | CFcf.aliyuncs.com 609 | Httpdnshttpdns-api.aliyuncs.com 610 | Location-innerlocation-inner.aliyuncs.com 611 | Aasaas.aliyuncs.com 612 | Stssts.aliyuncs.com 613 | Dtsdts.aliyuncs.com 614 | Drcdrc.aliyuncs.com 615 | Pushcloudpush.aliyuncs.com 616 | Cmsmetrics.aliyuncs.com 617 | Slbslb.aliyuncs.com 618 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 619 | Domaindomain.aliyuncs.com 620 | Otsots-pop.aliyuncs.com 621 | Ossoss-cn-hangzhou.aliyuncs.com 622 | Ramram.aliyuncs.com 623 | Salessales.cn-hangzhou.aliyuncs.com 624 | Crmcrm-cn-hangzhou.aliyuncs.com 625 | OssAdminoss-admin.aliyuncs.com 626 | Alidnsalidns.aliyuncs.com 627 | Onsons.aliyuncs.com 628 | Cdncdn.aliyuncs.com 629 | 630 | 631 | 632 | cn-anhui-gov-1 633 | 634 | Ecsecs-cn-hangzhou.aliyuncs.com 635 | 636 | 637 | 638 | cn-hangzhou-finance 639 | 640 | Ossoss-cn-hzjbp-b-console.aliyuncs.com 641 | 642 | 643 | 644 | cn-hangzhou 645 | 646 | ARMSarms.cn-hangzhou.aliyuncs.com 647 | CScs.aliyuncs.com 648 | COScos.aliyuncs.com 649 | Essess.aliyuncs.com 650 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 651 | Billingbilling.aliyuncs.com 652 | Dqsdqs.aliyuncs.com 653 | Ddsmongodb.aliyuncs.com 654 | Stssts.aliyuncs.com 655 | Smssms.aliyuncs.com 656 | Msgmsg-inner.aliyuncs.com 657 | Jaqjaq.aliyuncs.com 658 | Pushcloudpush.aliyuncs.com 659 | Livelive.aliyuncs.com 660 | Kmskms.cn-hangzhou.aliyuncs.com 661 | Locationlocation.aliyuncs.com 662 | Hpchpc.aliyuncs.com 663 | ChargingServicechargingservice.aliyuncs.com 664 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 665 | Alertalert.aliyuncs.com 666 | Mscmsc-inner.aliyuncs.com 667 | Drcdrc.aliyuncs.com 668 | Yundunyundun-cn-hangzhou.aliyuncs.com 669 | Ubsms-innerubsms-inner.aliyuncs.com 670 | Ocsm-kvstore.aliyuncs.com 671 | Dmdm.aliyuncs.com 672 | Greengreen.cn-hangzhou.aliyuncs.com 673 | Commondrivercommon.driver.aliyuncs.com 674 | oceanbaseoceanbase.aliyuncs.com 675 | Workorderworkorder.aliyuncs.com 676 | Yundunhsmyundunhsm.aliyuncs.com 677 | Iotiot.aliyuncs.com 678 | jaqjaq.aliyuncs.com 679 | Omsoms.aliyuncs.com 680 | livelive.aliyuncs.com 681 | Ecsecs-cn-hangzhou.aliyuncs.com 682 | M-kvstorem-kvstore.aliyuncs.com 683 | Vpcvpc.aliyuncs.com 684 | BatchComputebatchCompute.aliyuncs.com 685 | Domaindomain.aliyuncs.com 686 | AMSams.aliyuncs.com 687 | ROSros.aliyuncs.com 688 | PTSpts.aliyuncs.com 689 | Qualitycheckqualitycheck.aliyuncs.com 690 | Ubsmsubsms.aliyuncs.com 691 | Apigatewayapigateway.cn-hangzhou.aliyuncs.com 692 | CloudAPIapigateway.cn-hangzhou.aliyuncs.com 693 | CmsSiteMonitorsitemonitor.aliyuncs.com 694 | Aceace.cn-hangzhou.aliyuncs.com 695 | Mtsmts.cn-hangzhou.aliyuncs.com 696 | Oascn-hangzhou.oas.aliyuncs.com 697 | CFcf.aliyuncs.com 698 | Acsacs.aliyun-inc.com 699 | Httpdnshttpdns-api.aliyuncs.com 700 | Location-innerlocation-inner.aliyuncs.com 701 | Aasaas.aliyuncs.com 702 | Alidnsalidns.aliyuncs.com 703 | HPChpc.aliyuncs.com 704 | Emremr.aliyuncs.com 705 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 706 | Vpc-innervpc-inner.aliyuncs.com 707 | Cmsmetrics.cn-hangzhou.aliyuncs.com 708 | Slbslb.aliyuncs.com 709 | Riskrisk-cn-hangzhou.aliyuncs.com 710 | Dtsdts.aliyuncs.com 711 | Bssbss.aliyuncs.com 712 | Otsots-pop.aliyuncs.com 713 | Cdncdn.aliyuncs.com 714 | Ramram.aliyuncs.com 715 | Drdsdrds.aliyuncs.com 716 | Rdsrds.aliyuncs.com 717 | Crmcrm-cn-hangzhou.aliyuncs.com 718 | OssAdminoss-admin.aliyuncs.com 719 | Salessales.cn-hangzhou.aliyuncs.com 720 | Onsons.aliyuncs.com 721 | Ossoss-cn-hangzhou.aliyuncs.com 722 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 723 | 724 | 725 | 726 | cn-beijing-inner 727 | 728 | Riskrisk-cn-hangzhou.aliyuncs.com 729 | COScos.aliyuncs.com 730 | HPChpc.aliyuncs.com 731 | Billingbilling.aliyuncs.com 732 | Dqsdqs.aliyuncs.com 733 | Ddsmongodb.aliyuncs.com 734 | Emremr.aliyuncs.com 735 | Smssms.aliyuncs.com 736 | Drdsdrds.aliyuncs.com 737 | CScs.aliyuncs.com 738 | Locationlocation.aliyuncs.com 739 | ChargingServicechargingservice.aliyuncs.com 740 | Msgmsg-inner.aliyuncs.com 741 | Essess.aliyuncs.com 742 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 743 | Bssbss.aliyuncs.com 744 | Workorderworkorder.aliyuncs.com 745 | Drcdrc.aliyuncs.com 746 | Yundunyundun-cn-hangzhou.aliyuncs.com 747 | Ubsms-innerubsms-inner.aliyuncs.com 748 | Ocsm-kvstore.aliyuncs.com 749 | Dmdm.aliyuncs.com 750 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 751 | oceanbaseoceanbase.aliyuncs.com 752 | Mscmsc-inner.aliyuncs.com 753 | Yundunhsmyundunhsm.aliyuncs.com 754 | Iotiot.aliyuncs.com 755 | jaqjaq.aliyuncs.com 756 | Omsoms.aliyuncs.com 757 | M-kvstorem-kvstore.aliyuncs.com 758 | livelive.aliyuncs.com 759 | Ecsecs-cn-hangzhou.aliyuncs.com 760 | Alertalert.aliyuncs.com 761 | CmsSiteMonitorsitemonitor.aliyuncs.com 762 | Aceace.cn-hangzhou.aliyuncs.com 763 | AMSams.aliyuncs.com 764 | Otsots-pop.aliyuncs.com 765 | PTSpts.aliyuncs.com 766 | Qualitycheckqualitycheck.aliyuncs.com 767 | Ubsmsubsms.aliyuncs.com 768 | Stssts.aliyuncs.com 769 | Rdsrds.aliyuncs.com 770 | Mtsmts.cn-beijing.aliyuncs.com 771 | Location-innerlocation-inner.aliyuncs.com 772 | CFcf.aliyuncs.com 773 | Httpdnshttpdns-api.aliyuncs.com 774 | Greengreen.aliyuncs.com 775 | Aasaas.aliyuncs.com 776 | Alidnsalidns.aliyuncs.com 777 | Pushcloudpush.aliyuncs.com 778 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 779 | Cmsmetrics.aliyuncs.com 780 | Slbslb.aliyuncs.com 781 | Commondrivercommon.driver.aliyuncs.com 782 | Dtsdts.aliyuncs.com 783 | Domaindomain.aliyuncs.com 784 | ROSros.aliyuncs.com 785 | Ossoss-cn-hangzhou.aliyuncs.com 786 | Ramram.aliyuncs.com 787 | Salessales.cn-hangzhou.aliyuncs.com 788 | Crmcrm-cn-hangzhou.aliyuncs.com 789 | OssAdminoss-admin.aliyuncs.com 790 | Onsons.aliyuncs.com 791 | Cdncdn.aliyuncs.com 792 | 793 | 794 | 795 | cn-haidian-cm12-c01 796 | 797 | Ecsecs-cn-hangzhou.aliyuncs.com 798 | Vpcvpc.aliyuncs.com 799 | Rdsrds.aliyuncs.com 800 | 801 | 802 | 803 | cn-anhui-gov 804 | 805 | Ecsecs-cn-hangzhou.aliyuncs.com 806 | Vpcvpc.aliyuncs.com 807 | 808 | 809 | 810 | cn-shenzhen 811 | 812 | ARMSarms.cn-shenzhen.aliyuncs.com 813 | CScs.aliyuncs.com 814 | COScos.aliyuncs.com 815 | Onsons.aliyuncs.com 816 | Essess.aliyuncs.com 817 | Dqsdqs.aliyuncs.com 818 | Ddsmongodb.aliyuncs.com 819 | Alidnsalidns.aliyuncs.com 820 | Smssms.aliyuncs.com 821 | Jaqjaq.aliyuncs.com 822 | Pushcloudpush.aliyuncs.com 823 | Kmskms.cn-shenzhen.aliyuncs.com 824 | Locationlocation.aliyuncs.com 825 | Ocsm-kvstore.aliyuncs.com 826 | Alertalert.aliyuncs.com 827 | Drcdrc.aliyuncs.com 828 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 829 | Yundunyundun-cn-hangzhou.aliyuncs.com 830 | Ubsms-innerubsms-inner.aliyuncs.com 831 | Dmdm.aliyuncs.com 832 | Commondrivercommon.driver.aliyuncs.com 833 | oceanbaseoceanbase.aliyuncs.com 834 | Iotiot.aliyuncs.com 835 | HPChpc.aliyuncs.com 836 | Bssbss.aliyuncs.com 837 | Omsoms.aliyuncs.com 838 | Ubsmsubsms.aliyuncs.com 839 | livelive.aliyuncs.com 840 | Ecsecs-cn-hangzhou.aliyuncs.com 841 | M-kvstorem-kvstore.aliyuncs.com 842 | CmsSiteMonitorsitemonitor.aliyuncs.com 843 | BatchComputebatchcompute.cn-shenzhen.aliyuncs.com 844 | Aceace.cn-hangzhou.aliyuncs.com 845 | ROSros.aliyuncs.com 846 | PTSpts.aliyuncs.com 847 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 848 | Apigatewayapigateway.cn-shenzhen.aliyuncs.com 849 | CloudAPIapigateway.cn-shenzhen.aliyuncs.com 850 | Stssts.aliyuncs.com 851 | Vpcvpc.aliyuncs.com 852 | Rdsrds.aliyuncs.com 853 | Mtsmts.cn-shenzhen.aliyuncs.com 854 | Oascn-shenzhen.oas.aliyuncs.com 855 | CFcf.aliyuncs.com 856 | Acsacs.aliyun-inc.com 857 | Crmcrm-cn-hangzhou.aliyuncs.com 858 | Location-innerlocation-inner.aliyuncs.com 859 | Aasaas.aliyuncs.com 860 | Emremr.aliyuncs.com 861 | Dtsdts.aliyuncs.com 862 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 863 | Vpc-innervpc-inner.aliyuncs.com 864 | Cmsmetrics.cn-hangzhou.aliyuncs.com 865 | Slbslb.aliyuncs.com 866 | Riskrisk-cn-hangzhou.aliyuncs.com 867 | Domaindomain.aliyuncs.com 868 | Otsots-pop.aliyuncs.com 869 | jaqjaq.aliyuncs.com 870 | Cdncdn.aliyuncs.com 871 | Ramram.aliyuncs.com 872 | Drdsdrds.aliyuncs.com 873 | OssAdminoss-admin.aliyuncs.com 874 | Greengreen.aliyuncs.com 875 | Httpdnshttpdns-api.aliyuncs.com 876 | Ossoss-cn-shenzhen.aliyuncs.com 877 | 878 | 879 | 880 | ap-southeast-2 881 | 882 | Rdsrds.ap-southeast-2.aliyuncs.com 883 | Kmskms.ap-southeast-2.aliyuncs.com 884 | Vpcvpc.ap-southeast-2.aliyuncs.com 885 | Ecsecs.ap-southeast-2.aliyuncs.com 886 | Cmsmetrics.cn-hangzhou.aliyuncs.com 887 | Slbslb.ap-southeast-2.aliyuncs.com 888 | 889 | 890 | 891 | cn-qingdao 892 | 893 | CScs.aliyuncs.com 894 | COScos.aliyuncs.com 895 | HPChpc.aliyuncs.com 896 | Dqsdqs.aliyuncs.com 897 | Ddsmongodb.aliyuncs.com 898 | Emremr.cn-qingdao.aliyuncs.com 899 | Smssms.aliyuncs.com 900 | Jaqjaq.aliyuncs.com 901 | Dtsdts.aliyuncs.com 902 | Locationlocation.aliyuncs.com 903 | Essess.aliyuncs.com 904 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 905 | Alertalert.aliyuncs.com 906 | Drcdrc.aliyuncs.com 907 | Yundunyundun-cn-hangzhou.aliyuncs.com 908 | Ubsms-innerubsms-inner.cn-qingdao.aliyuncs.com 909 | Ocsm-kvstore.aliyuncs.com 910 | Dmdm.aliyuncs.com 911 | Riskrisk-cn-hangzhou.aliyuncs.com 912 | oceanbaseoceanbase.aliyuncs.com 913 | Iotiot.aliyuncs.com 914 | Bssbss.aliyuncs.com 915 | Omsoms.aliyuncs.com 916 | Ubsmsubsms.cn-qingdao.aliyuncs.com 917 | livelive.aliyuncs.com 918 | Ecsecs-cn-hangzhou.aliyuncs.com 919 | M-kvstorem-kvstore.aliyuncs.com 920 | CmsSiteMonitorsitemonitor.aliyuncs.com 921 | BatchComputebatchcompute.cn-qingdao.aliyuncs.com 922 | Aceace.cn-hangzhou.aliyuncs.com 923 | Otsots-pop.aliyuncs.com 924 | PTSpts.aliyuncs.com 925 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 926 | Apigatewayapigateway.cn-qingdao.aliyuncs.com 927 | CloudAPIapigateway.cn-qingdao.aliyuncs.com 928 | Stssts.aliyuncs.com 929 | Rdsrds.aliyuncs.com 930 | Mtsmts.cn-qingdao.aliyuncs.com 931 | Location-innerlocation-inner.aliyuncs.com 932 | CFcf.aliyuncs.com 933 | Acsacs.aliyun-inc.com 934 | Httpdnshttpdns-api.aliyuncs.com 935 | Greengreen.aliyuncs.com 936 | Aasaas.aliyuncs.com 937 | Alidnsalidns.aliyuncs.com 938 | Pushcloudpush.aliyuncs.com 939 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 940 | Vpc-innervpc-inner.aliyuncs.com 941 | Cmsmetrics.cn-hangzhou.aliyuncs.com 942 | Slbslb.aliyuncs.com 943 | Commondrivercommon.driver.aliyuncs.com 944 | Domaindomain.aliyuncs.com 945 | ROSros.aliyuncs.com 946 | jaqjaq.aliyuncs.com 947 | Cdncdn.aliyuncs.com 948 | Ramram.aliyuncs.com 949 | Drdsdrds.aliyuncs.com 950 | Crmcrm-cn-hangzhou.aliyuncs.com 951 | OssAdminoss-admin.aliyuncs.com 952 | Onsons.aliyuncs.com 953 | Ossoss-cn-qingdao.aliyuncs.com 954 | 955 | 956 | 957 | cn-shenzhen-su18-b02 958 | 959 | Ecsecs-cn-hangzhou.aliyuncs.com 960 | 961 | 962 | 963 | cn-shenzhen-su18-b03 964 | 965 | Ecsecs-cn-hangzhou.aliyuncs.com 966 | 967 | 968 | 969 | cn-shenzhen-su18-b01 970 | 971 | Ecsecs-cn-hangzhou.aliyuncs.com 972 | 973 | 974 | 975 | ap-southeast-antgroup-1 976 | 977 | Ecsecs-cn-hangzhou.aliyuncs.com 978 | 979 | 980 | 981 | oss-cn-bjzwy 982 | 983 | Ossoss-cn-bjzwy.aliyuncs.com 984 | 985 | 986 | 987 | cn-henan-am12001 988 | 989 | Ecsecs-cn-hangzhou.aliyuncs.com 990 | Vpcvpc.aliyuncs.com 991 | 992 | 993 | 994 | cn-beijing 995 | 996 | ARMSarms.cn-beijing.aliyuncs.com 997 | CScs.aliyuncs.com 998 | COScos.aliyuncs.com 999 | Jaqjaq.aliyuncs.com 1000 | Essess.aliyuncs.com 1001 | Billingbilling.aliyuncs.com 1002 | Dqsdqs.aliyuncs.com 1003 | Ddsmongodb.aliyuncs.com 1004 | Stssts.aliyuncs.com 1005 | Smssms.aliyuncs.com 1006 | Msgmsg-inner.aliyuncs.com 1007 | Salessales.cn-hangzhou.aliyuncs.com 1008 | HPChpc.aliyuncs.com 1009 | Oascn-beijing.oas.aliyuncs.com 1010 | Locationlocation.aliyuncs.com 1011 | Onsons.aliyuncs.com 1012 | ChargingServicechargingservice.aliyuncs.com 1013 | Hpchpc.aliyuncs.com 1014 | Commondrivercommon.driver.aliyuncs.com 1015 | Ocsm-kvstore.aliyuncs.com 1016 | jaqjaq.aliyuncs.com 1017 | Workorderworkorder.aliyuncs.com 1018 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 1019 | Bssbss.aliyuncs.com 1020 | Ubsms-innerubsms-inner.aliyuncs.com 1021 | Dmdm.aliyuncs.com 1022 | Riskrisk-cn-hangzhou.aliyuncs.com 1023 | oceanbaseoceanbase.aliyuncs.com 1024 | Mscmsc-inner.aliyuncs.com 1025 | Yundunhsmyundunhsm.aliyuncs.com 1026 | Iotiot.aliyuncs.com 1027 | Alertalert.aliyuncs.com 1028 | Omsoms.aliyuncs.com 1029 | Ubsmsubsms.aliyuncs.com 1030 | livelive.aliyuncs.com 1031 | Ecsecs-cn-hangzhou.aliyuncs.com 1032 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 1033 | Vpcvpc.aliyuncs.com 1034 | BatchComputebatchCompute.aliyuncs.com 1035 | AMSams.aliyuncs.com 1036 | ROSros.aliyuncs.com 1037 | PTSpts.aliyuncs.com 1038 | M-kvstorem-kvstore.aliyuncs.com 1039 | Apigatewayapigateway.cn-beijing.aliyuncs.com 1040 | CloudAPIapigateway.cn-beijing.aliyuncs.com 1041 | Kmskms.cn-beijing.aliyuncs.com 1042 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 1043 | CmsSiteMonitorsitemonitor.aliyuncs.com 1044 | Aceace.cn-hangzhou.aliyuncs.com 1045 | Mtsmts.cn-beijing.aliyuncs.com 1046 | CFcf.aliyuncs.com 1047 | Acsacs.aliyun-inc.com 1048 | Httpdnshttpdns-api.aliyuncs.com 1049 | Location-innerlocation-inner.aliyuncs.com 1050 | Aasaas.aliyuncs.com 1051 | Emremr.aliyuncs.com 1052 | Dtsdts.aliyuncs.com 1053 | Drcdrc.aliyuncs.com 1054 | Pushcloudpush.aliyuncs.com 1055 | Cmsmetrics.cn-hangzhou.aliyuncs.com 1056 | Slbslb.aliyuncs.com 1057 | Crmcrm-cn-hangzhou.aliyuncs.com 1058 | Domaindomain.aliyuncs.com 1059 | Otsots-pop.aliyuncs.com 1060 | Ossoss-cn-beijing.aliyuncs.com 1061 | Ramram.aliyuncs.com 1062 | Drdsdrds.aliyuncs.com 1063 | Vpc-innervpc-inner.aliyuncs.com 1064 | Rdsrds.aliyuncs.com 1065 | OssAdminoss-admin.aliyuncs.com 1066 | Alidnsalidns.aliyuncs.com 1067 | Greengreen.aliyuncs.com 1068 | Yundunyundun-cn-hangzhou.aliyuncs.com 1069 | Cdncdn.aliyuncs.com 1070 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 1071 | vodvod.cn-beijing.aliyuncs.com 1072 | 1073 | 1074 | 1075 | cn-hangzhou-d 1076 | 1077 | CScs.aliyuncs.com 1078 | COScos.aliyuncs.com 1079 | Essess.aliyuncs.com 1080 | Billingbilling.aliyuncs.com 1081 | Dqsdqs.aliyuncs.com 1082 | Ddsmongodb.aliyuncs.com 1083 | Emremr.aliyuncs.com 1084 | Smssms.aliyuncs.com 1085 | Salessales.cn-hangzhou.aliyuncs.com 1086 | Dtsdts.aliyuncs.com 1087 | Locationlocation.aliyuncs.com 1088 | Msgmsg-inner.aliyuncs.com 1089 | ChargingServicechargingservice.aliyuncs.com 1090 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 1091 | Bssbss.aliyuncs.com 1092 | Mscmsc-inner.aliyuncs.com 1093 | Ocsm-kvstore.aliyuncs.com 1094 | Yundunyundun-cn-hangzhou.aliyuncs.com 1095 | Ubsms-innerubsms-inner.aliyuncs.com 1096 | Dmdm.aliyuncs.com 1097 | Riskrisk-cn-hangzhou.aliyuncs.com 1098 | oceanbaseoceanbase.aliyuncs.com 1099 | Workorderworkorder.aliyuncs.com 1100 | Alidnsalidns.aliyuncs.com 1101 | Iotiot.aliyuncs.com 1102 | HPChpc.aliyuncs.com 1103 | jaqjaq.aliyuncs.com 1104 | Omsoms.aliyuncs.com 1105 | livelive.aliyuncs.com 1106 | Ecsecs-cn-hangzhou.aliyuncs.com 1107 | M-kvstorem-kvstore.aliyuncs.com 1108 | CmsSiteMonitorsitemonitor.aliyuncs.com 1109 | Alertalert.aliyuncs.com 1110 | Aceace.cn-hangzhou.aliyuncs.com 1111 | AMSams.aliyuncs.com 1112 | Otsots-pop.aliyuncs.com 1113 | PTSpts.aliyuncs.com 1114 | Qualitycheckqualitycheck.aliyuncs.com 1115 | Ubsmsubsms.aliyuncs.com 1116 | Rdsrds.aliyuncs.com 1117 | Mtsmts.cn-hangzhou.aliyuncs.com 1118 | Location-innerlocation-inner.aliyuncs.com 1119 | CFcf.aliyuncs.com 1120 | Httpdnshttpdns-api.aliyuncs.com 1121 | Greengreen.aliyuncs.com 1122 | Aasaas.aliyuncs.com 1123 | Stssts.aliyuncs.com 1124 | Pushcloudpush.aliyuncs.com 1125 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 1126 | Cmsmetrics.aliyuncs.com 1127 | Slbslb.aliyuncs.com 1128 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 1129 | Domaindomain.aliyuncs.com 1130 | Commondrivercommon.driver.aliyuncs.com 1131 | ROSros.aliyuncs.com 1132 | Cdncdn.aliyuncs.com 1133 | Ramram.aliyuncs.com 1134 | Drdsdrds.aliyuncs.com 1135 | Crmcrm-cn-hangzhou.aliyuncs.com 1136 | OssAdminoss-admin.aliyuncs.com 1137 | Onsons.aliyuncs.com 1138 | Yundunhsmyundunhsm.aliyuncs.com 1139 | Drcdrc.aliyuncs.com 1140 | Ossoss-cn-hangzhou.aliyuncs.com 1141 | 1142 | 1143 | 1144 | cn-gansu-am6 1145 | 1146 | Ecsecs-cn-hangzhou.aliyuncs.com 1147 | Vpcvpc.aliyuncs.com 1148 | Rdsrds.aliyuncs.com 1149 | 1150 | 1151 | 1152 | cn-ningxiazhongwei 1153 | 1154 | Ecsecs-cn-hangzhou.aliyuncs.com 1155 | Vpcvpc.aliyuncs.com 1156 | 1157 | 1158 | 1159 | cn-shanghai-et2-b01 1160 | 1161 | CScs.aliyuncs.com 1162 | Riskrisk-cn-hangzhou.aliyuncs.com 1163 | COScos.aliyuncs.com 1164 | Onsons.aliyuncs.com 1165 | Essess.aliyuncs.com 1166 | Billingbilling.aliyuncs.com 1167 | Dqsdqs.aliyuncs.com 1168 | Ddsmongodb.aliyuncs.com 1169 | Alidnsalidns.aliyuncs.com 1170 | Smssms.aliyuncs.com 1171 | Jaqjaq.aliyuncs.com 1172 | Dtsdts.aliyuncs.com 1173 | Locationlocation.aliyuncs.com 1174 | Msgmsg-inner.aliyuncs.com 1175 | ChargingServicechargingservice.aliyuncs.com 1176 | Ocsm-kvstore.aliyuncs.com 1177 | Bssbss.aliyuncs.com 1178 | Mscmsc-inner.aliyuncs.com 1179 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 1180 | Yundunyundun-cn-hangzhou.aliyuncs.com 1181 | Ubsms-innerubsms-inner.aliyuncs.com 1182 | Dmdm.aliyuncs.com 1183 | Commondrivercommon.driver.aliyuncs.com 1184 | oceanbaseoceanbase.aliyuncs.com 1185 | Workorderworkorder.aliyuncs.com 1186 | Yundunhsmyundunhsm.aliyuncs.com 1187 | Iotiot.aliyuncs.com 1188 | jaqjaq.aliyuncs.com 1189 | Omsoms.aliyuncs.com 1190 | Ubsmsubsms.aliyuncs.com 1191 | livelive.aliyuncs.com 1192 | Ecsecs-cn-hangzhou.aliyuncs.com 1193 | Ace-opsace-ops.cn-hangzhou.aliyuncs.com 1194 | CmsSiteMonitorsitemonitor.aliyuncs.com 1195 | BatchComputebatchCompute.aliyuncs.com 1196 | Aceace.cn-hangzhou.aliyuncs.com 1197 | AMSams.aliyuncs.com 1198 | Otsots-pop.aliyuncs.com 1199 | PTSpts.aliyuncs.com 1200 | Qualitycheckqualitycheck.aliyuncs.com 1201 | M-kvstorem-kvstore.aliyuncs.com 1202 | Rdsrds.aliyuncs.com 1203 | Mtsmts.cn-hangzhou.aliyuncs.com 1204 | CFcf.aliyuncs.com 1205 | Acsacs.aliyun-inc.com 1206 | Httpdnshttpdns-api.aliyuncs.com 1207 | Location-innerlocation-inner.aliyuncs.com 1208 | Aasaas.aliyuncs.com 1209 | Stssts.aliyuncs.com 1210 | HPChpc.aliyuncs.com 1211 | Emremr.aliyuncs.com 1212 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 1213 | Pushcloudpush.aliyuncs.com 1214 | Cmsmetrics.aliyuncs.com 1215 | Slbslb.aliyuncs.com 1216 | Crmcrm-cn-hangzhou.aliyuncs.com 1217 | Alertalert.aliyuncs.com 1218 | Domaindomain.aliyuncs.com 1219 | ROSros.aliyuncs.com 1220 | Cdncdn.aliyuncs.com 1221 | Ramram.aliyuncs.com 1222 | Drdsdrds.aliyuncs.com 1223 | Vpc-innervpc-inner.aliyuncs.com 1224 | OssAdminoss-admin.aliyuncs.com 1225 | Salessales.cn-hangzhou.aliyuncs.com 1226 | Greengreen.aliyuncs.com 1227 | Drcdrc.aliyuncs.com 1228 | Ossoss-cn-hangzhou.aliyuncs.com 1229 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 1230 | 1231 | 1232 | 1233 | cn-ningxia-am7-c01 1234 | 1235 | Ecsecs-cn-hangzhou.aliyuncs.com 1236 | Vpcvpc.aliyuncs.com 1237 | 1238 | 1239 | 1240 | cn-shenzhen-finance-1 1241 | 1242 | Kmskms.cn-shenzhen-finance-1.aliyuncs.com 1243 | Ecsecs-cn-hangzhou.aliyuncs.com 1244 | Rdsrds.aliyuncs.com 1245 | Vpcvpc.aliyuncs.com 1246 | 1247 | 1248 | 1249 | ap-southeast-1 1250 | 1251 | CScs.aliyuncs.com 1252 | Riskrisk-cn-hangzhou.aliyuncs.com 1253 | COScos.aliyuncs.com 1254 | Essess.aliyuncs.com 1255 | Billingbilling.aliyuncs.com 1256 | Dqsdqs.aliyuncs.com 1257 | Ddsmongodb.aliyuncs.com 1258 | Alidnsalidns.aliyuncs.com 1259 | Smssms.aliyuncs.com 1260 | Drdsdrds.aliyuncs.com 1261 | Dtsdts.aliyuncs.com 1262 | Kmskms.ap-southeast-1.aliyuncs.com 1263 | Locationlocation.aliyuncs.com 1264 | Msgmsg-inner.aliyuncs.com 1265 | ChargingServicechargingservice.aliyuncs.com 1266 | R-kvstorer-kvstore-cn-hangzhou.aliyuncs.com 1267 | Alertalert.aliyuncs.com 1268 | Mscmsc-inner.aliyuncs.com 1269 | HighDDosyd-highddos-cn-hangzhou.aliyuncs.com 1270 | Yundunyundun-cn-hangzhou.aliyuncs.com 1271 | Ubsms-innerubsms-inner.aliyuncs.com 1272 | Ocsm-kvstore.aliyuncs.com 1273 | Dmdm.aliyuncs.com 1274 | Greengreen.aliyuncs.com 1275 | Commondrivercommon.driver.aliyuncs.com 1276 | oceanbaseoceanbase.aliyuncs.com 1277 | Workorderworkorder.aliyuncs.com 1278 | Yundunhsmyundunhsm.aliyuncs.com 1279 | Iotiot.aliyuncs.com 1280 | HPChpc.aliyuncs.com 1281 | jaqjaq.aliyuncs.com 1282 | Omsoms.aliyuncs.com 1283 | livelive.aliyuncs.com 1284 | Ecsecs-cn-hangzhou.aliyuncs.com 1285 | M-kvstorem-kvstore.aliyuncs.com 1286 | Vpcvpc.aliyuncs.com 1287 | BatchComputebatchCompute.aliyuncs.com 1288 | AMSams.aliyuncs.com 1289 | ROSros.aliyuncs.com 1290 | PTSpts.aliyuncs.com 1291 | Qualitycheckqualitycheck.aliyuncs.com 1292 | Bssbss.aliyuncs.com 1293 | Ubsmsubsms.aliyuncs.com 1294 | Apigatewayapigateway.ap-southeast-1.aliyuncs.com 1295 | CloudAPIapigateway.ap-southeast-1.aliyuncs.com 1296 | Stssts.aliyuncs.com 1297 | CmsSiteMonitorsitemonitor.aliyuncs.com 1298 | Aceace.cn-hangzhou.aliyuncs.com 1299 | Mtsmts.ap-southeast-1.aliyuncs.com 1300 | CFcf.aliyuncs.com 1301 | Crmcrm-cn-hangzhou.aliyuncs.com 1302 | Location-innerlocation-inner.aliyuncs.com 1303 | Aasaas.aliyuncs.com 1304 | Emremr.ap-southeast-1.aliyuncs.com 1305 | Httpdnshttpdns-api.aliyuncs.com 1306 | Drcdrc.aliyuncs.com 1307 | Pushcloudpush.aliyuncs.com 1308 | Cmsmetrics.cn-hangzhou.aliyuncs.com 1309 | Slbslb.aliyuncs.com 1310 | YundunDdosinner-yundun-ddos.cn-hangzhou.aliyuncs.com 1311 | Domaindomain.aliyuncs.com 1312 | Otsots-pop.aliyuncs.com 1313 | Cdncdn.aliyuncs.com 1314 | Ramram.aliyuncs.com 1315 | Salessales.cn-hangzhou.aliyuncs.com 1316 | Rdsrds.aliyuncs.com 1317 | OssAdminoss-admin.aliyuncs.com 1318 | Onsons.aliyuncs.com 1319 | Ossoss-ap-southeast-1.aliyuncs.com 1320 | 1321 | 1322 | 1323 | cn-shenzhen-st4-d01 1324 | 1325 | Ecsecs-cn-hangzhou.aliyuncs.com 1326 | 1327 | 1328 | 1329 | eu-central-1 1330 | 1331 | Rdsrds.eu-central-1.aliyuncs.com 1332 | Ecsecs.eu-central-1.aliyuncs.com 1333 | Vpcvpc.eu-central-1.aliyuncs.com 1334 | Kmskms.eu-central-1.aliyuncs.com 1335 | Cmsmetrics.cn-hangzhou.aliyuncs.com 1336 | Slbslb.eu-central-1.aliyuncs.com 1337 | 1338 | 1339 | 1340 | cn-zhangjiakou 1341 | 1342 | Rdsrds.cn-zhangjiakou.aliyuncs.com 1343 | Ecsecs.cn-zhangjiakou.aliyuncs.com 1344 | Vpcvpc.cn-zhangjiakou.aliyuncs.com 1345 | Cmsmetrics.cn-hangzhou.aliyuncs.com 1346 | Slbslb.cn-zhangjiakou.aliyuncs.com 1347 | 1348 | 1349 | 1350 | --------------------------------------------------------------------------------