pengbo37877

1703 经验值

xcx

如图显示,服务器端可以收到用户发的消息,但是在微信的客服网页端收不到转发消息,大大们能看出来问题吗

帮看看哪里有问题

public function serve()
    {
        $options = [
            'app_id'    => 'xxxxxxxxx',
            'secret'    => 'xxxxxxxx',
            'token'     => 'xxxxxxxx',
            'log' => [
                'level' => 'debug',
                'file'  => '/tmp/easywechat.log',
            ],
        ];

        $app = Factory::miniProgram($options);

        $server = $app->server;

        $server->push(function($message) use ($app){
            Log::info($message);

            if($message['MsgType'] == 'event' && $message['Event'] == 'user_enter_tempsession') {
                $this->enterEventMsg($message);
            }else{
                $t = new Transfer();
                return $t;
            }
            return "666";
        });

        $server->serve()->send();
    }

实现了,不是你说的这个逻辑,做一个token管理就行,不要频繁去换token

是的,后来更新到jwt 1.0.0.beta.3问题解决

首先说一下版本
"laravel/framework": "5.4.*",
"tymon/jwt-auth": "0.5.*",

刷新token的代码如下
$api->group(['middleware' => 'jwt.auth'], function ($api) {

    $api->get('refresh', [
        'middleware' => 'jwt.refresh',
        function() {
            return response()->json([
                'message' => 'By accessing this endpoint, you can refresh your access token at each request. Check out this response headers!',
                'user' => user()
            ]);
        }
    ]);

ssl=1,
refresh_ssl=2

当访问refresh接口的时间>1分钟的时候返回
{
"error": "token_expired"
}

不是应该可以刷新token的吗?token带在返回的headers里面,求大大们解答。

原来是primaryKey的问题,谢谢教主

数据库中有,Model没有指定,如何指定primaryKey呢

Illuminate\Database\QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'by_worker.id' in 'on clause' (SQL: select by_worker.*, by_workerorderrelation.OrderID as pivot_OrderID, by_workerorderrelation.WorkerID as pivot_WorkerID from by_worker inner join by_workerorderrelation on by_worker.id = by_workerorderrelation.WorkerID where by_workerorderrelation.OrderID is null)'

按照这个方法会报这样的错误