1.redis

平时直接启动没问题,今天出了这个问题,启动失败,加上配置文件也不行。

D:\redis2.8>redis-server.exe
[8264] 08 Nov 09:28:43.943 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server.exe /path/to/redis.conf
[8264] 08 Nov 09:28:43.948 # Creating Server TCP listening socket *:6379: bind: No such file or directory

Redis报错:

[6644] 02 Apr 23:11:58.976 # Creating Server TCP listening socket *:6379: bind: No such file or directory

的解决方案如下按顺序输入如下命令就可以连接成功

1. redis-cli.exe
2. shutdown
3. exit
4. redis-server.exe redis.windows.conf

2.larave-echo-server

 

"database": "redis",
    "databaseConfig": {
        "redis": {
            "port":"6379",
            "host":"127.0.0.1" //不可以http://locahost
        }
    },
3.
status
500
沒有c設定csrf
400 token沒過
4.
public function boot()
{
Broadcast::routes(['middleware' => ['jwt.auth']]);
 
Broadcast::channel('chat-room.1', function () {
return true;
});
+ require base_path('routes/channels.php');

5.

import VueEcho from 'vue-echo'
const io = window.io = require('socket.io-client');
 
Vue.use(VueSweetAlert)
Vue.config.productionTip = false
Vue.use(vueaxios,axios)
Vue.use(Auth)
Vue.use(VueEcho,{
broadcaster: 'socket.io',
key:'36e77906f0963e755c057cf3bb2cf1da',
host: 'http://localhost:6001',
auth:{headers:{
Authorization:'Bearer '+Vue.auth.getToken()
}}
6. sortBy merge pivot
$list=collect($user->have_chat())->sortByDesc('pivot.created_at')->values()->all();

 

可以sortBy([],[])

7.notification 要在User model 自訂預設的頻道名稱

public function receivesBroadcastNotificationsOn()
{
return 'App.User.'.$this->id;
}
8.javascript 判斷是否物件有東西
if(Object.keys(this.nowChatUser).length>0){

javascript 判斷是否陣列有東西

.length>0

9.axios canceltoken undefine

axios.interceptors.request.use((config) => {
  if(config.method === 'post') {
    config.data = qs.stringify(config.data);
  }
  return config;  //添加这一行
}, (error) => {
  return Promise.reject(error);
});

10.jwtauth token axios interceptor

Vue.axios.interceptors.request.use(config=>{
if(Vue.auth.getToken()){
config.headers['Authorization']='Bearer '+Vue.auth.getToken()
 
}
return config
})
 
arrow
arrow
    全站熱搜

    學習程式 發表在 痞客邦 留言(0) 人氣()