作者 lyh

gx

... ... @@ -60,8 +60,6 @@ class Common
response('指令不存在',400);
}
//带原语种翻译
var_dump($param['keywords']);
die();
$result = Translate::translateSl($param['keywords'])->json();
if (FALSE == empty($result['texts']['sl']) && FALSE == empty(Translate::$tls_list[$result['texts']['sl']])) {
$lang = Translate::$tls_list[$result['texts']['sl']]['lang_en'];
... ...
... ... @@ -16,7 +16,8 @@ use Illuminate\Support\Facades\Http;
class Translate
{
//接口地址
public static $url = 'https://translate.hbb618.cn/translates';
// public static $url = 'https://translate.hbb618.cn/translates';
public static $url = 'https://translate.hbbapi.com/';
public static $tls_list = [
'en' => [
... ... @@ -713,6 +714,7 @@ class Translate
*/
public static function translate($texts, $tls)
{
$action = 'translates';
if (is_string($texts)) {
$texts = [$texts];
}
... ... @@ -724,7 +726,7 @@ class Translate
'sl' => 'auto',
'tls' => $tls,
];
return Http::post(self::$url, $data);
return Http::post(self::$url.$action, $data);
}
/**
... ...