<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\SoftApi; use ModStart\Core\Input\InputPackage; class SoftApiUtil { public static function url() { return 'https://api.' . __BASE_SITE__; } private static function instance($vwCA5) { $DxXWh = modstart_config(); return SoftApi::instance($DxXWh->getWithEnv("{$vwCA5}AppId"), $DxXWh->getWithEnv("{$vwCA5}AppSecret")); } public static function audioConvert($G6ONv, $Lcunu, $XOCfS) { goto wAISG; wAISG: $DxXWh = modstart_config(); goto rp5RY; EGITn: if (empty($SEb7x)) { $SEb7x = $DxXWh->getWithEnv('softApiDefaultAppId'); $cC5Py = $DxXWh->getWithEnv('softApiDefaultAppSecret'); } goto sm8Xe; sm8Xe: $P1ZC1 = SoftApi::instance($SEb7x, $cC5Py); goto xirKO; qUytC: if ($yvBIN['code']) { return null; } goto XJHeZ; xirKO: $yvBIN = $P1ZC1->audioConvert($G6ONv, $Lcunu, base64_encode($XOCfS)); goto qUytC; XJHeZ: return base64_decode($yvBIN['data']['content']); goto nxnXn; rp5RY: $SEb7x = $DxXWh->getWithEnv('softApiAudioConvertAppId'); goto WjOl2; WjOl2: $cC5Py = $DxXWh->getWithEnv('softApiAudioConvertAppSecret'); goto EGITn; nxnXn: } public static function asr($aA2dJ, $XOCfS) { goto AjIA6; JpLPV: $yvBIN = $P1ZC1->asr($aA2dJ, base64_encode($XOCfS)); goto MJQpj; ZzaCW: $SEb7x = $DxXWh->getWithEnv('softApiAsrAppId'); goto jAL_P; UUIyd: if (empty($SEb7x)) { $SEb7x = $DxXWh->getWithEnv('softApiDefaultAppId'); $cC5Py = $DxXWh->getWithEnv('softApiDefaultAppSecret'); } goto g8dlb; jAL_P: $cC5Py = $DxXWh->getWithEnv('softApiAsrAppSecret'); goto UUIyd; AjIA6: $DxXWh = modstart_config(); goto ZzaCW; g8dlb: $P1ZC1 = SoftApi::instance($SEb7x, $cC5Py); goto JpLPV; MJQpj: if ($yvBIN['code']) { return null; } goto IuZIY; IuZIY: return $yvBIN['data']['text']; goto lxeex; lxeex: } public static function express($aA2dJ, $l7iM0) { goto ZvFoP; bmKK2: $yvBIN = $P1ZC1->express($aA2dJ, $l7iM0); goto BSxD4; JWUSw: $cC5Py = $DxXWh->getWithEnv('softApiExpressAppSecret'); goto Dahzf; lcIvz: return $yvBIN['data']['list']; goto eTkZm; a9hmC: $SEb7x = $DxXWh->getWithEnv('softApiExpressAppId'); goto JWUSw; ZvFoP: $DxXWh = modstart_config(); goto a9hmC; Dahzf: if (empty($SEb7x)) { $SEb7x = $DxXWh->getWithEnv('softApiDefaultAppId'); $cC5Py = $DxXWh->getWithEnv('softApiDefaultAppSecret'); } goto GuYFr; GuYFr: $P1ZC1 = SoftApi::instance($SEb7x, $cC5Py); goto bmKK2; BSxD4: if ($yvBIN['code']) { return array(); } goto lcIvz; eTkZm: } public static function captchaIsEnable() { return !!modstart_config('softApiCaptchaEnable', false); } public static function captchaScript() { return '<script src="https://api.' . __BASE_SITE__ . '/lib/captcha/base-1.0.0.js?20200410"></script>'; } public static function captchaAppId() { return modstart_config('softApiCaptchaAppId'); } public static function captchaVerify() { $Cj1F4 = InputPackage::buildFromInput(); return self::instance('softApiCaptcha')->captchaVerify($Cj1F4->getTrimString('action'), $Cj1F4->getTrimString('key'), $Cj1F4->getTrimString('data'), $Cj1F4->getTrimString('runtime'), $Cj1F4->getTrimString('types')); } public static function captchaValidate($mCUqA) { goto QmlKi; v_YZ2: return true; goto hqGM_; AiAsA: if ($yvBIN['code']) { return false; } goto v_YZ2; QmlKi: $yvBIN = self::instance('softApiCaptcha')->captchaValidate($mCUqA); goto AiAsA; hqGM_: } }