|
|
@@ -11,6 +11,10 @@ use think\facade\Session;
|
|
|
use think\facade\Db;
|
|
|
use GatewayClient\Gateway;
|
|
|
|
|
|
+use Google\Cloud\Translate\V3\Client\TranslationServiceClient;
|
|
|
+use Google\Cloud\Translate\V3\TranslateTextRequest;
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 控制器基础类
|
|
|
*/
|
|
|
@@ -46,6 +50,17 @@ class User
|
|
|
//客户端登录
|
|
|
public function login(){
|
|
|
|
|
|
+ // $client = new TranslationServiceClient();
|
|
|
+
|
|
|
+ // $request = new TranslateTextRequest();
|
|
|
+ // $request->setTargetLanguageCode('en-US');
|
|
|
+ // $request->setContents(['こんにちは']);
|
|
|
+ // $request->setParent('projects/php-docs-samples-kokoro');
|
|
|
+
|
|
|
+ // // The request and response will be logged to STDOUT when the environment
|
|
|
+ // // variable GOOGLE_SDK_PHP_LOGGING=true
|
|
|
+ // $response = $client->translateText($request);
|
|
|
+ // print_r($response);die;
|
|
|
$params=request()->param();
|
|
|
$where['role'] = 0;
|
|
|
if (empty($params['account']) || empty($params['uid']) || empty($params['from'])) {
|