自我做的客服聊天以来,让我做一套聊天应用的呼声越来越多,加上那套客服聊天由于没有组件化、UI设计等问题,也让我一直心有遗憾做的不够完美,于是利用空余时间做了一套相对完整的聊天应用。HasChat 是一套使用全新技术完成的通讯聊天网页。
-
前端:Vue3 + Vite + TypeScript + Naive UI + Socket.io
-
后端:Express.js
作者开源目的旨在给刚学习该领域的新人一些引路,不管你是前端还是后端,都能对你在通讯聊天这个领域有一点点的启发。
HasChat聊天应用
-
登陆、随机获取用户登陆
-
发送邮箱验证码注册
-
发送表情+文字组合的富文本内容
-
发送图片内容,查看大图
-
enter发送信息,enter+ctrl换行输入内容
-
消息提醒
-
未读消息标记
-
记录历史会话
-
记录历史聊天内容
-
切换主题
-
前端:暂无版本区别
-
后端:分为mysql版本(分支main)和json版本(分支master);json版本主要是为了不懂mysql的新手学习;
Node.Js >= 12.0.0
Mysql >= 5.7.0 (仅mysql版本需要,但执行mysql文件需要8.0以上版本)
https://gitee.com/howcode/has-chat.git
后端 mysql版本
git clone -b main https://gitee.com/howcode/has-chat-service.git
后端 json版本
git clone -b master https://gitee.com/howcode/has-chat-service.git
npm install
- 在mysql的版本中,找到目录store下的sql文件,运行sql文件
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a05eb49a4a9eee786c28372ad5f8e7c6.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/70e3cf0533b25cfe6da5032f587fac36.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f8602b760df2d87915ccfb178cd14904.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/c2452e1117453e2a451862fc45d60870.png)
- 依次运行两个sql文件,并且刷新数据库表就可看到了
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/57c609f148bd1d0ec383e8de742e0f83.png)
- 找到config.js文件
const db = mysql.createConnection({
host: "",
user: "",
password: "",
database: ""
更多配置查看:nodejs-mysql
emailConfig: {
host: "smtp.qq.com",
port: 465,
secure: true,
auth: {
user: "",
pass: ""
详情使用可以查看该文章:nodejs发送邮箱信息
node app.js
npm run dev
到此,项目可以正常运行
haschat
├── src
│ └── api
│ └── assets
│ └── css
│ └── emo
│ └── icon
│ └── img
│ └── mp3
│ └── class
│ └── components
│ └── ChatContent.vue
│ └── ChatDomain.vue
│ └── ChatEditor.vue
│ └── ChatFoot.vue
│ └── ChatHead.vue
│ └── ChatNav.vue
│ └── HasChat.vue
│ └── enums
│ └── json
│ └── router
│ └── store
│ └── utils
│ └── views
字段 | 类型 | 描述 |
---|
Id | number | 用户Id |
Name | string | 用户姓名 |
NickName | string | 用户昵称 |
OnlineState | boolean | 在线状态 |
Mobile | string | 用户手机号 |
Avatar | string | 用户头像 |
字段 | 类型 | 描述 |
---|
Id | number | 内容Id |
SendId | number | 发送人Id |
ReciverId | number | 接受人Id |
Content | string | 内容 |
Type | number | 类型 |
State | number | 发送状态 |
NoCode | string | 信息编号 |
CreateDateUtc | string | 创建时间 |
Title | string | 拓展功能字段 |
Description | string | 拓展功能字段 |
Label | string | 拓展功能字段 |
Thumbnail | string | 拓展功能字段 |
ReadFlag | boolean | 是否阅读 |
Avatar | string | 发送者用户头像 |
id
:用户Id,必传
接口地址 : /api/getUserById
id
:除去的用户Id,必传
接口地址 : /api/userList
接口地址 : /api/getRandomUser
email
:账户,必传
password
:密码,必传
接口地址 : /api/login
email
:邮箱,必传
name
:用户名,必传
password
:密码,必传
surePassword
:确认密码,必传
接口地址 : /api/register
email
:邮箱,必传
timestamp
:时间戳,自动携带
接口地址 : /api/sendVerificationCode
verificationCode
:验证码,必传
timestamp
:时间戳,自动携带
接口地址 : /api/checkVerificationCode
SendId
:发送者Id,必传
NoCode
:时间戳,自动携带
store.state.socket.emit("joinChat", {
SendId: xxx,
NoCode: xxx,
});
Conversition
:发送内容对象(查看Conversition类),必传
ReciverId
:接收者Id,必传
SendId
:发送者Id,必传
store.state.socket.emit("sendMsg", {
Conversition: xxx,
ReciverId: xxx,
SendId: xxx,
});
ReciverId
:接收者Id,必传
SendId
:发送者Id,必传
store.state.socket.emit("changeMsgRead", {
ReciverId: xxx,
SendId: xxx,
});
SendId
:发送者Id,必传
Revicer
:接受者对象(可查看Use类),必传
store.state.socket.emit("insertHistorySession", {
SendId: xxx,
Revicer: xxx,
});
一、本项目宗旨在于为广大的正在学习通讯方面的新手提供学习、思路
二、本项目资源全部免费分享,包括前端源码、后端转源码等。本项目不会利用任何资源进行任何的销售盈利活动。
三、任何情况下,因使用本项目进行违法犯罪的行为,本人不承担任何法律责任。
- 发送图片上传到服务器,以src路径形式获取
- 发送视频功能
- 群聊功能
- 发送视频
- uni-app开发混合app/h5/小程序版本
hashcat是世界上最快、最先进的密码恢复实用程序,支持针对 300 多种高度优化的哈希算法的五种独特攻击模式。hashcat 目前支持 Linux、Windows 和 macOS 上的 CPU、GPU 和其他硬件加速器,并具有帮助启用分布式密码破解的工具。
-h #查看使用
-m #指定hash类型
-a #攻击模块
hashcat -m 5600 w::DESKTOP-75AQPA5:2ce8cf18e7c62a8b:304F04A46CF0F3249E628FB0F64D1D6F:01010000
Hashcat是自称世界上最快的密码恢复工具。它在2015年之前拥有专有代码库,但现在作为免费软件发布。适用于Linux,OS X和Windows的版本可以使用基于CPU或基于GPU的变体。支持hashcat的散列算法有Microsoft LM哈希,MD4,MD5,SHA系列,Unix加密格式,MySQL和Cisco PIX等。
hashcat支持多种计算核心:
AP...
11-03 Connect the XPO Profiler to an ASP.NET Core Application(将 XPO 分析器连接到 ASP.NET Core 应用程序)~11-04