[ 'Content-Type: application/json' ], ]; public function __construct($appKey='', $appSecret = '', $sourceId) { $this->objCommon = new Common($appKey, $appSecret, $sourceId); } /** * 官方文档地址: http://newopen.imdada.cn/#/development/file/cityList?_k=m88rtv * 获取城市信息列表 * */ public function cityCodeList() { $postData = $this->objCommon->CommonRequestParams(); $postData['body'] = ''; $postData['signature'] = $this->objCommon->getSignature($postData); $url = $this->baseUrl . '/api/cityCode/list'; $response = request($url, json_encode($postData, JSON_UNESCAPED_UNICODE), 5, true, $this->commonHeader); $result = $this->objCommon->commonResponse($response); if (!$result->isSuccess()) { return ResultWrapper::fail($result->getData(), $result->getErrorCode()); } return ResultWrapper::success($result->getData()); } }