/** * api入口 */ public function api() { $this->userInfo = D('User')->getUserFromOpenId(ImWx::getRequestUserId()); switch (ImWx::getRequestType()) { case 'text': $this->_handleTextMessage(); break; case 'event': $this->_handleEventMessage(); break; case 'image': case 'link': case 'location': case 'voice': ImWx::fetchTextResult('……'); break; } $this->responseError(new CommonException('200202')); }
public static function generateEntryUrl($text = '个人中心') { $openid = ImWx::getRequestUserId(); return '<a href="' . SITE_URL . 'index/wechat_entrance/wechat_id/' . $openid . '">' . $text . '</a>(链接包含您的登录信息,请不要分享)'; }