作者 lyh

gx

... ... @@ -18,11 +18,6 @@ class Translate
//接口地址
// public static $url = 'https://translate.hbb618.cn/translates';
public static $url = 'https://api.cmer.com/';
public static $header = array(
"Accept: application/json",
"Content-Type:application/json",
"apikey: UkzZljFv83Z2qBi5YR1o3f2otAVWtug6"
);
public static $tls_list = [
'en' => [
... ... @@ -739,7 +734,7 @@ class Translate
'sl' => 'auto',
'tls' => $tls,
];
return http_post(self::$url.$action, json_encode($data));
return Http::post(self::$url.$action, $data);
}
/**
... ... @@ -754,10 +749,10 @@ class Translate
if (!$texts) {
return '';
}
$res = self::translate($texts, $tls);
var_dump($res);
die();
return $res[0]['texts'] ?? '';
$retsult = self::translate($texts, $tls)->json();
return $retsult[0]['texts'] ?? '';
}
/**
... ...