@@ -0,0 +1,286 @@
This template should help get you started developing with Vue 3 in Vite.
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensionsfrom VSCode's command palette - Find
TypeScript and JavaScript Language Features, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Windowfrom the command palette.
See Vite Configuration Reference.
npm installnpm run devnpm run build- 博客主页动画及内容展示
- 博客主页天气功能
- 博客知识库分类、标签分类组合查询
- 自定义分页组件
- 博客评论功能的实现-可使用emoji。
- 博客流量统计及地理位置获取
1.阅读量统计采用cookie判断是否阅读过
| 键名 | 解释 |
|---|---|
| id | 编号 |
| name | 知识库名 |
| icon | 标签图片 |
| count | 在此知识库中的文章数目 |
| articles | 此知识库中的文章id |
| 键名 | 解释 |
|---|---|
| id | 编号 |
| name | 标签名 |
| color | 颜色 |
| count | 带有此标签的文章数目 |
| articles | 带有此标签的文章id |
| 键名 | 解释 |
|---|---|
| id | 编号 |
| title | 文章标题 |
| library | 知识库名 |
| libraryId | 知识库Id |
| libraryIcon | 知识库图片 |
| labels | 标签,对象数组格式,字段同标签表 |
| publicTime | 发布时间 |
| updateTime | 更新时间 |
| read | 阅读量(请求次数) |
| commentNum | 评论数目统计 |
| comments | 评论对象 数组 |
| content | md格式正文 |
| commentable | 是否可评论 |
| 字段 | 解释 |
|---|---|
| id | 编号 |
| articleId | 所属文章编号 |
| masterId | 所属顶级评论编号,若无,则为0 |
| parentId | 父级评论号,若无父级评论,则为0 |
| parentInfo | 父级评论信息,仅在parentId!=masterId的时候出现,包括父级评论的邮箱和内容 |
| content | 评论内容 |
| 邮箱名 | |
| reply | 评论对象的数组,若无则为空 |
| time | 时间 |
| country | 国家 |
| province | 省份 |
| city | 城市 |
| commentAvatar | 评论使用的头像 |
cookie规则:
若无cookie,则新建一个,并给一个过期时间,将文章号加入isRead,并在read表新建一条数据
若有cookie,判断是否过期
若已过期,同上新建
若未过期,则更新过期时间,判断是否在isRead中,若不在,则在read表新建;
若在,则在read表中查询时间,若时间间隔超过1天,则新建一条记录
| 键名 | 解释 |
|---|---|
| id | 序号 |
| cookie | cookie |
| expiredTime | 过期时间(每次请求接口时更新过期时间) |
| isRead | 阅读过的文章 |
| province | 访问省份 |
| city | 访问城市 |
| 键名 | 解释 |
|---|---|
| id | 序号 |
| cookie | cookie |
| readArticleId | 阅读文章号 |
| openTime | 打开时间 |
每次请求接口都需要更新cookie的expire时间,判断有无cookie/cookie是否过期,根据结果决定是否赋予新cookie
{
"code":200,
"success":true,
"data":{
},
"msg":成功
}/blog/getLibraries
{
"code":200,
"success":true,
"data":{
},
"msg":成功
}/blog/getLabels
{
"code":200,
"success":true,
"data":{
},
"msg":成功
}{
"code":200,
"success":true,
"data":{
},
"msg":成功
}{
"code":200,
"success":true,
"data":{
},
"msg":成功
}{
"code":200,
"success":true,
"data":{
},
"msg":成功
}{
"code":200,
"success":true,
"data":{
},
"msg":成功
}{
"code":200,
"success":true,
"data":{
},
"msg":成功
}