ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ public function ajaxRequestAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); header('Content-type: application/json'); try { if (! $this->getRequest()->isPost()) throw new Exception('非法提交', 100); $result = array( 'code' => 200, 'msg' => '请求成功' ); } catch (Exception $e) { $result = array( 'code' => $e->getCode(), 'msg' => $e->getMessage() ); } echo Zend_Json::encode($result); } ~~~