user = $user; } /** * Execute the job. * * @return void * @throws GuzzleException */ public function handle() { $params = [ 'jsonrpc' => '2.0', 'id' => 1, 'method' => 'Chain33.Query', 'params' => [ [ 'execer' => 'chat', 'funcName' => 'GetUser', 'payload' => [ 'mainAddress' => $this->user->username, 'targetAddress' => $this->user->username, ] ] ], ]; $client = new Client([ 'base_uri' => '152.136.224.167:8901' ]); $result = $client->post('', [ 'body' => json_encode($params), ]); $json = json_decode($result->getBody()->getContents(), true); $collect = collect($json['result']['fields']); $this->user->info()->create([ 'nickname' => $collect->where('name', 'nickname')->first()['value'] ?? null, 'avatar' => $collect->where('name', 'avatar')->first()['value'] ?? null, ]); $params = [ 'Identifier' => (string) $this->user->id, 'Nick' => $collect->where('name', 'nickname')->first()['value'] ?? '', 'FaceUrl' => $collect->where('name', 'avatar')->first()['value'] ?? '', ]; app('im')->send('im_open_login_svc', 'account_import', $params); } }