regionId('cn-hangzhou') ->asDefaultClient(); $token = request()->input('access_token'); if (empty($token)) throw new \Exception("缺少阿里云access_token"); try { $result = AlibabaCloud::rpc() ->product('Dypnsapi') ->scheme('https') // https | http ->version('2017-05-25') ->action('GetMobile') ->method('POST') ->host('dypnsapi.aliyuncs.com') ->options([ 'query' => [ 'RegionId' => "cn-hangzhou", 'AccessToken' => $token, ], ]) ->request(); $result = $result->toArray(); if ($result['Code'] == 'OK') { return $result['GetMobileResultDTO']['Mobile']; } return false; } catch (ClientException $e) { $this->getError($e); return false; } catch (ServerException $e) { $this->getError($e); return false; } catch (\Exception $e) { $this->getError($e); return false; } } }