作者 lyh

gx

@@ -60,8 +60,6 @@ class Common @@ -60,8 +60,6 @@ class Common
60 response('指令不存在',400); 60 response('指令不存在',400);
61 } 61 }
62 //带原语种翻译 62 //带原语种翻译
63 - var_dump($param['keywords']);  
64 - die();  
65 $result = Translate::translateSl($param['keywords'])->json(); 63 $result = Translate::translateSl($param['keywords'])->json();
66 if (FALSE == empty($result['texts']['sl']) && FALSE == empty(Translate::$tls_list[$result['texts']['sl']])) { 64 if (FALSE == empty($result['texts']['sl']) && FALSE == empty(Translate::$tls_list[$result['texts']['sl']])) {
67 $lang = Translate::$tls_list[$result['texts']['sl']]['lang_en']; 65 $lang = Translate::$tls_list[$result['texts']['sl']]['lang_en'];
@@ -16,7 +16,8 @@ use Illuminate\Support\Facades\Http; @@ -16,7 +16,8 @@ use Illuminate\Support\Facades\Http;
16 class Translate 16 class Translate
17 { 17 {
18 //接口地址 18 //接口地址
19 - public static $url = 'https://translate.hbb618.cn/translates'; 19 +// public static $url = 'https://translate.hbb618.cn/translates';
  20 + public static $url = 'https://translate.hbbapi.com/';
20 21
21 public static $tls_list = [ 22 public static $tls_list = [
22 'en' => [ 23 'en' => [
@@ -713,6 +714,7 @@ class Translate @@ -713,6 +714,7 @@ class Translate
713 */ 714 */
714 public static function translate($texts, $tls) 715 public static function translate($texts, $tls)
715 { 716 {
  717 + $action = 'translates';
716 if (is_string($texts)) { 718 if (is_string($texts)) {
717 $texts = [$texts]; 719 $texts = [$texts];
718 } 720 }
@@ -724,7 +726,7 @@ class Translate @@ -724,7 +726,7 @@ class Translate
724 'sl' => 'auto', 726 'sl' => 'auto',
725 'tls' => $tls, 727 'tls' => $tls,
726 ]; 728 ];
727 - return Http::post(self::$url, $data); 729 + return Http::post(self::$url.$action, $data);
728 } 730 }
729 731
730 /** 732 /**