只说重点,不说废话和解释,自己去看代码, 不贴大量的图片的,下面的demo链接都可以看。
1. 开发环境介绍
2. 体验demo
前端博客:demo (支持移动端访问).
admin系统: 游客模式访问. 账号:test 密码:0000
微信小程序搜索:10个肉包子
仓库代码地址
3. 功能
- 文章
- 分类
- 登录 注册
- 验证码(手机/邮箱)
- ip限流
- 评论回复(敏感词校验)
4. 技术栈
- PC博客: vue全家桶
- PC后台管理系统:react全家桶+antd
- 小程序端: mpvue
- 服务端:egg
- 服务器:Centos 2核2G5M pm2 nginx
- FTP: fileZilla
5. 特色功能
- 阿里云的短信服务
- 阿里云的文本服务
- IP限流处理(每日100次)
- 游客模式访问真实数据
6. 返回状态码
200 成功
201 结果校验失败
202 参数违法
300 无权限操作
401 没有权限
403 ip 被限流/被封
422 参数错误
7. 数据库结构
- 用户表 user
字段 | 解释 | type | 枚举值 |
---|
id | 主键 | int | |
nickname | 昵称 | string | |
username | 账号 | string | 登录账号(邮箱/手机号) |
password | 密码 | string | |
root | 等级 | int | 0.默认 77.root |
status | 用户状态 | int | 1.默认 0 禁用 |
create_time | 创建时间 | timestamp | |
update_time | 更新时间 | timestamp | |
- 文章表 article
字段 | 解释 | type | 备注 |
---|
id | 主键 | int | |
title | 文章标题 | string | |
author | 文章作者 | string | |
introduction | 文章介绍 | string | |
tag | 文章标签 | string | |
cover | 文章封面 | string | |
bucket | 目录层级 | string | |
content | 文章内容 | string | 数据字段为:text,长度 1000000 |
browser | 浏览次数 | int | |
is_del | 是否软删除 | int | 1 上架 2 下架 |
istop | 置顶 | int | 0 普通 1 置顶 |
create_time | 创建时间 | timestamp | |
update_time | 更新时间 | timestamp | |
- 文章分类表 category
字段 | 解释 | type |
---|
id | 主键 | int |
name | 名称 | string |
create_time | 创建时间 | timestamp |
update_time | 更新时间 | timestamp |
- 文章评论
字段 | 解释 | type |
---|
id | 主键 | int |
article_id | 文章 id | int |
content | 内容 | string |
user_id | 评论用户 id | int |
create_time | 创建时间 | timestamp |
update_time | 更新时间 | timestamp |
字段 | 解释 | type |
---|
id | 主键 | int |
comment_id | 评论 id | int |
content | 内容 | string |
to_id | 目标用户 id | int |
from_id | 评论用户 id | int |
create_time | 创建时间 | timestamp |
update_time | 更新时间 | timestamp |
- 验证码表 code
字段 | 解释 | type | 解释 |
---|
id | 主键 | int | |
code | 名称 | string | |
username | 账号 | string | |
type | 类型 | int | 1 邮箱 2 短信 |
create_time | 创建时间 | timestamp | |
update_time | 更新时间 | timestamp | |
- IP 表 ip
字段 | 解释 | type |
---|
id | 主键 | int |
ip | 名称 | string [primary key] |
client | 客户端 | string |
day | 单日次数 | int |
total | 总访问次数 | int |
userId | 用户 id | int |
create_time | 创建时间 | timestamp |
update_time | 更新时间 | timestamp |