'ok', # 小于0为失败 0 => '暂时未处理', 1100 => '商品不存在', ); protected string $uid = ''; protected string $secretKey = ''; # code码定义 # 查询接口 一般用于查询数据,同步执行 # 提交接口 一般用于提交数据,异步执行 public function getAppId() { $response = [ 'appId'=>2025011935557114401 ]; $this->yes($response); } protected function getAppSecret() { return 'ez8bfsrgefga5nkx5zgccegrb25mct7w'; } /** * 返回成功的消息 * @param mixed $info * @param string $data * @param integer $code */ protected function yes($data = '{-null-}', $info = 'ok', $code = 200) { $response = [ 'code' => $code, 'message' => $info, 'data' => $data ]; throw new HttpResponseException(json($response)); } }