Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用状态频道时使用laravel和pusher的身份验证代码错误_Javascript_Php_Laravel_Vue.js_Pusher - Fatal编程技术网

Javascript 使用状态频道时使用laravel和pusher的身份验证代码错误

Javascript 使用状态频道时使用laravel和pusher的身份验证代码错误,javascript,php,laravel,vue.js,pusher,Javascript,Php,Laravel,Vue.js,Pusher,我正在我的网站上创建聊天室功能。但是,当客户端在频道上发送/broadcasting/auth请求时,返回的auth代码格式不正确。具体来说,它在开头添加了一个冒号。然而,它只在生产过程中这样做,而不是在本地 routes/channels.php Broadcast::channel('Chat.{roomId}', function ($user, $roomId) { return ['id' => $user->id, 'name' => $user->na

我正在我的网站上创建聊天室功能。但是,当客户端在频道上发送/broadcasting/auth请求时,返回的auth代码格式不正确。具体来说,它在开头添加了一个冒号。然而,它只在生产过程中这样做,而不是在本地

routes/channels.php

Broadcast::channel('Chat.{roomId}', function ($user, $roomId) {
  return ['id' => $user->id, 'name' => $user->name];
});
[/broadcasting/auth response][1]

实际上,我也遇到了同样的问题,通过设置以下环境最终解决了这个问题

PUSHER_APP_ID=xxxxxxxx
PUSHER_APP_KEY=xxxxxxx
PUSHER_APP_SECRET=xxxx
PUSHER_APP_CLUSTER=ap3