正在显示
1 个修改的文件
包含
8 行增加
和
1 行删除
| @@ -19,6 +19,13 @@ class Translate | @@ -19,6 +19,13 @@ class Translate | ||
| 19 | // public static $url = 'https://translate.hbb618.cn/translates'; | 19 | // public static $url = 'https://translate.hbb618.cn/translates'; |
| 20 | public static $url = 'https://api.cmer.com/'; | 20 | public static $url = 'https://api.cmer.com/'; |
| 21 | 21 | ||
| 22 | + public static $header = array( | ||
| 23 | + 'accept: application/json', | ||
| 24 | + 'Content-Type: application/json', | ||
| 25 | + 'apikey: UkzZljFv83Z2qBi5YR1o3f2otAVWtug6', | ||
| 26 | + 'X-CmerApi-Host:ai_translate.p.cmer.com' | ||
| 27 | + ); | ||
| 28 | + | ||
| 22 | public static $tls_list = [ | 29 | public static $tls_list = [ |
| 23 | 'en' => [ | 30 | 'en' => [ |
| 24 | 'text' => '英语', | 31 | 'text' => '英语', |
| @@ -734,7 +741,7 @@ class Translate | @@ -734,7 +741,7 @@ class Translate | ||
| 734 | 'sl' => 'auto', | 741 | 'sl' => 'auto', |
| 735 | 'tls' => $tls, | 742 | 'tls' => $tls, |
| 736 | ]; | 743 | ]; |
| 737 | - return Http::post(self::$url.$action, $data); | 744 | + return http_post(self::$url.$action, json_encode($data),self::$header); |
| 738 | } | 745 | } |
| 739 | 746 | ||
| 740 | /** | 747 | /** |
-
请 注册 或 登录 后发表评论