getMessage()}"; } /* 分别执行对应类型的操作 */ switch (strtolower($wechat->getMsgType())) { case 'text': $receive = $wechat->getReceive(); if ($receive['Content'] === 'TESTCOMPONENT_MSG_TYPE_TEXT') { return $wechat->text('TESTCOMPONENT_MSG_TYPE_TEXT_callback')->reply([], true); } else { $key = str_replace("QUERY_AUTH_CODE:", '', $receive['Content']); WechatService::WeOpenService()->getQueryAuthorizerInfo($key); return $wechat->text("{$key}_from_api")->reply([], true); } case 'event': $receive = $wechat->getReceive(); return $wechat->text("{$receive['Event']}from_callback")->reply([], true); default: return 'success'; } } }