作者 SHW\戥岁。。
... ... @@ -97,9 +97,8 @@ class Notify extends Api
$buymodel->isUpdate(false)->saveAll($data);
// 给后台发送新订单提醒
$client = new Client();
$domain = config('socketio.domain');
$http_port = config('socketio.http_port');
$client->request('POST', $domain . ":{$http_port}/", [
$client->request('POST', request()->domain() . ":{$http_port}/", [
'form_params' => [
'type' => 'publish',
'content' => '您有新的订单,请注意查收',
... ...
<?php
return [
/**
* 域名
*/
'domain' => 'http://temporaryfood.n.broing.cn',
/**
* socket端口
*/
'socket_port' => 2120,
... ...
... ... @@ -367,7 +367,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form','/assets
$(document).ready(function () {
var uid=$('.orders').attr('data-uid');
// 连接服务端
var socket = io('http://'+document.domain+':2120');
var socket = io(document.domain+':2120');
// 连接后登录
socket.on('connect', function(){
socket.emit('login', uid);
... ...