嗯加入了一些新的json 也嘗試用reload restart
后端代碼概率會(huì)丟失之前的json
{"type":"say","from_client_id":"7f00000108fe00000001","from_client_name":"\u79cb\u6708","to_client_id":"all","img":"這是個(gè)參數(shù)","content":"123","talk":"這也是個(gè)參數(shù)","time":"2023-05-30 10:52:48"}
這個(gè)是正常的
但是 有時(shí)候刷新
就會(huì)變成第一版
{"type":"say","from_client_id":"7f00000108ff00000004","from_client_name":"\u5929\u9053","to_client_id":"all","content":"123","time":"2023-05-30 11:02:52"}
少了 img talk這個(gè)參數(shù)
$new_message = array(
'type'=>'say',
'from_client_id'=>$client_id,
'from_client_name' =>$client_name,
'to_client_id'=>'all',
'img' => $img,
'content'=>nl2br(htmlspecialchars($message_data['content'])),
'talk'=> $talk,
'time'=>date('Y-m-d H:i:s'),
);
return Gateway::sendToGroup($room_id ,json_encode($new_message));
就是刷新幾次 就會(huì)出現(xiàn)上個(gè)版本的 不加載我現(xiàn)在的文件
{
"name" : "workerman/workerman-chat",
"type" : "project",
"keywords": ["chat"],
"homepage": "http://m.wtbis.cn",
"license" : "MIT",
"require": {
"workerman/gateway-worker" : "^v3.0.23||^4.0.0",
"ext-json": "*",
"revolt/event-loop": "^1.0",
"workerman/mysql": "^1.0"
},
"autoload": {
"psr-4": {
"": "./",
"": "./Applications/Chat/"
}
}
}