Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

消息接受和回复时,如果不对消息做回复,该如何做? #117

Closed
qqjt opened this issue Oct 10, 2015 · 4 comments
Closed

Comments

@qqjt
Copy link

qqjt commented Oct 10, 2015

我直接在$server->on('message')的回调方法里return false,提示“该公众号暂时无法提供服务,请稍后再试”。
http://mp.weixin.qq.com/wiki/14/89b871b5466b19b3efa4ada8e577d45e.html 微信文档里说回复空串或success,我该怎么做呢?

@overtrue
Copy link
Collaborator

返回空字符串,或者你啥也不干

@overtrue
Copy link
Collaborator

不要$server->on,只return $server->serve()

@qqjt
Copy link
Author

qqjt commented Oct 12, 2015

<?php

namespace App\Http\Controllers\Wechat;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Overtrue\Wechat\Server;

class ServerController extends Controller
{
    public function serve(Server $server)
    {
        $server->on('message', function($message){
            //return "OK!";
        });
        return $server;
    }
}

使用了laravel-wechat,什么也不做不行啊,用的微信接口测试帐号。只return $server->serve()那怎么做规则匹配呢?

@overtrue
Copy link
Collaborator

请升级到2.1.10

@overtrue overtrue reopened this Oct 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants