|
...
|
...
|
@@ -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);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|