uid = $uid; } /** * Execute the job. * * @return void */ public function handle() { $exists = QappUserAddDestop::where('uid', $this->uid)->exists(); if ($exists) { return; } $client = new Client(); $params = [ 'uid' => $this->uid, 'source' => 'zsy' ]; $params['sign'] = _sign($params, SysConsts::TIKTOK_KEY); $url = env('TIKTOK_API_URL').'api/qappuser/addDesk'; myLog('user_add_desk')->info(compact('url')); myLog('user_add_desk')->info($params); $response = $client->post($url, ['form_params' => $params])->getBody()->getContents(); myLog('user_add_desk')->info($response); $result = json_decode($response); if ($result) { if ($result->code == 0) { QappUserAddDestop::create([ 'uid' => $this->uid, 'status' => 1, ]); } myLog('user_add_desk')->info(json_encode(['code' => $result->code,'msg' => $result->msg,'uid' => $this->uid])); } } }