Giter Club home page Giter Club logo

thinkphp-layim's Introduction

thinkphp-layim

前言

Thinkphp6 + GatewayWorker3 + Layim3 实现类 QQ 聊天功能。

总体原则:

  • 现有 mvc 框架项目与 GatewayWorker 可以独立部署互不干扰
  • 所有的业务逻辑都由网站页面 post/get 到 mvc 框架中完成
  • GatewayWorker 不接受客户端发来的数据,即 GatewayWorker 不处理任何业务逻辑,GatewayWorker 仅仅当做一个单向的推送通道
  • 仅当 mvc 框架需要向浏览器主动推送数据时才在 mvc 框架中调用 Gateway 的 API GatewayClient 完成推送

注意:layim 商用的话,请去 layui 官网获取授权。

任务使用方法

  1. 进入项目根目录
  2. 执行命令 composer install
  3. 拷贝 .example.env 文件为 .env,并配置正确的数据库
  4. 导入数据表 database/chat.sql
  5. 执行命令 php think run -p 8888,启动内置服务器。语法参照 thinkphp6 手册
  6. windows 环境双击 start_for_win.bat 或者 linux环境执行命令 php start_for_linux.php start
  7. 访问后台 http://127.0.0.1:8888
  8. 输入账号登录( 测试账号 cshaptx4869xianxin。密码都是 123456。当然也可以自己注册 )

Applications/Layim/config.php 可修改 GatewayWorker 的配置

app/controller/Chat.php 可修改请求的 WebSocket 地址

win 下效果展示

  • 双击启动脚本

  • 申请加好友

  • 同意加好友申请

  • 和好友聊天

  • 申请加群

  • 消息盒子通知

  • 同意加群申请

  • 系统通知

  • 群聊

特别感谢:

Workerman

Layui

thinkphp-layim's People

Contributors

cshaptx4869 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.