From dab551ddf5f2d2d0d744079aab9e70b443be13d0 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Thu, 24 Jan 2019 11:28:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: vilson <545522390@qq.com> --- README.md | 15 +++++++++++++-- .../common/Plugins/GateWayWorker/config.php | 6 +++--- config/config.php | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2a78d50..9ef6d03 100644 --- a/README.md +++ b/README.md @@ -63,16 +63,27 @@ Composer 3. 启动项目:npm run serve 4. 根据提示填写数据库信息进行安装 ![1](https://static.vilson.xyz/help/pearproject/3.png) -6. 打包项目(有必要的话) +6. 打包前端项目(有必要的话) 1. 修改./src/config/config.js,修改PRO_URL地址 2. 修改./vue.config.js,将publicPath 值改为‘/’。如果有CDN的话改为CDN地址 3. 运行cmd,输入 npm run build 4. 运行dist目录下的index.html,或者将dist目录下的文件部署到服务器上 7. 跨域支持 - 1. 默认开启跨域,如需关闭,须进行以下操作 + 1. 默认开启跨域,如需关闭,须在前端项目进行以下操作 1. 修改./src/config.js,将crossDomain 值改为‘false’ 2. 修改./vue.config.js,将DEV_URL的值改为接口的访问地址 3. 重启启动项目 +8. 消息推送 + 1. 后端 + 1. 进入application/common/Plugins/GateWayWorker + 2. 修改config.php,修改 SERVER_ADDRESS 的值为内网IP地址。端口号根据情况需改,注意服务器要放行对应的端口 + 3. 如果是HTTPS协议,需要开启SSL支持 + 4. Windows环境下,直接运行start_for_win.bat文件 + 5. Linux环境下,运行 bash start.sh 启动服务,运行 bash stop.sh 终止服务 + 2. 前端 + 1. 进入 src/config/config.js + 2.WS_URI 地址修改为相应的ip地址。如果使用https,不能写ip需要写域名 + ### 鼓励一下 ### Sample diff --git a/application/common/Plugins/GateWayWorker/config.php b/application/common/Plugins/GateWayWorker/config.php index 6db23fd..e629ba1 100644 --- a/application/common/Plugins/GateWayWorker/config.php +++ b/application/common/Plugins/GateWayWorker/config.php @@ -1,12 +1,12 @@ '/www/wwwroot/pms/server.pem', // 也可以是crt文件 - 'local_pk' => '/www/wwwroot/pms/server.key', + 'local_cert' => '/www/wwwroot/pearProjectApi/server.pem', // 也可以是crt文件 + 'local_pk' => '/www/wwwroot/pearProjectApi/server.key', 'verify_peer' => false, 'allow_self_signed' => true, //如果是自签名证书需要开启此选项 ));//ssl配置 diff --git a/config/config.php b/config/config.php index e399e83..7cb0d7a 100644 --- a/config/config.php +++ b/config/config.php @@ -1,4 +1,4 @@ false, + 'notice_push' => true, //是否开启websocket消息推送 ];