摘要:多人博客系统断断续续写了个单页面的博客系统其实是想给我和我的小伙伴写日记用的租了服务器写接口用反向代理也算是练练手。
多人博客系统
</>复制代码
断断续续写了个单页面的博客系统,其实是想给我和我的小伙伴写日记用的,租了do服务器,express写接口,用nginx反向代理,也算是练练手。不得不说国外的服务器还是做单页面更好
vue前台部分
前台依赖模块
功能模块</>复制代码
vue-cli
vue-router
vuex
axios
moment-timezone
vue-waterfall
wangeditor
canvas粒子效果
登录/注册
个人中心
添加文章
编辑文章
搜索文章
下拉加载列表
文章留言
H5多图上传
缩略图生成
图片瀑布流布局
路由配置</>复制代码
import Vue from "vue"
import VueRouter from "vue-router"
Vue.use(VueRouter);
import store from "../store/index"
import index from "../page/index"
import dairy from "../page/dairy"
import photo from "../page/photo"
import login from "../page/login"
import reg from "../page/reg"
import user from "../page/user"
import set from "../page/set"
import page from "../page/page"
import article from "../page/article"
import edit from "../page/edit"
import userIndex from "../components/user/index"
import userAlbum from "../components/user/album"
import userTogether from "../components/user/together"
import userInfo from "../components/user/info"
import setIndex from "../components/set/index"
import setFriend from "../components/set/friend"
import setPassword from "../components/set/password"
const routes = [{
path: "/",
component: index,
meta: { auth: false }
}, {
path: "/dairy",
component: dairy,
meta: { auth: false }
}, {
path: "/photo",
component: photo,
meta: { auth: false }
}, {
path: "/login",
component: login,
},{
path: "/reg",
component: reg,
meta: { auth: false }
},{
path: "/article",
component: article,
},{
path: "/p/:aid",
name: "page",
component: page,
meta: { auth: false }
},{
path: "/p/:aid/edit",
name: "edit",
component: edit,
},{
path : "/set",
component : set,
children : [{
path: "",
name: "setIndex",
component : setIndex,
},{
path : "password",
name: "setPassword",
component : setPassword,
},{
path : "friend",
name: "setFriend",
component : setFriend,
}]
}, {
path: "/u/:uid",
component: user,
children: [{
path: "",
name: "userIndex",
component: userIndex,
meta: { auth: false }
}, {
path: "album",
name: "userAlbum",
component: userAlbum,
meta: { auth: false }
}, {
path: "together",
name: "userTogether",
component: userTogether,
meta: { auth: false }
}, {
path: "info",
name: "userInfo",
component: userInfo,
meta: { auth: false }
}]
}];
const router = new VueRouter({
mode: "history",
saveScrollPosition: true,
routes
});
router.beforeEach(({meta, path}, from, next) => {
var { auth = true } = meta;
var isLogin = Boolean(store.state.auth.token); //true用户已登录, false用户未登录
if (auth && !isLogin && path !== "/login") {
return next({ path: "/login" })
}
if(isLogin && (path == "/login" || path == "/reg")){
return next({ path: "/" })
}
next()
});
export default router;
前台运行程序
</>复制代码
npm install
npm run dev
http://localhost:8080/
api后台部分
后台依赖模块
</>复制代码
express
mongoose
bluebird
jsonwebtoken
gm 需安装ImageMagick
后台文件目录
</>复制代码
│─ config
│ └─ index.js
│─ models
│ ├─ album.model.js
│ ├─ article.model.js
│ ├─ comment.model.js
│ └─ user.model.js
├─ public/uploads
├─ routes
│ ├─ album
│ │ ├─ album.controller.js
│ │ └─ index.js
│ ├─ article
│ │ ├─ article.controller.js
│ │ └─ index.js
│ ├─ auth
│ │ ├─ local
│ │ │ ├─ index.js
│ │ │ └─ passport.js
│ │ ├─ auth.service.js
│ │ └─ index.js
│ ├─ comment
│ │ ├─ comment.controller.js
│ │ └─ index.js
│ ├─ user
│ │ ├─ user.controller.js
│ │ └─ index.js
│ └─ index.js
├─ app.js
└─ package.json
后台运行程序
</>复制代码
npm install
开启mongodb
mongod --dbpath
node app
源码地址
前台界面
后台api
在线地址
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/82738.html
摘要:前言这个项目是利用工作之余写的一个模仿微信的单页面应用,整个项目包含个页面,涉及实时群聊,机器人聊天,同学录,朋友圈等等,后续页面还是开发中。 前言 这个项目是利用工作之余写的一个模仿微信app的单页面应用,整个项目包含27个页面,涉及实时群聊,机器人聊天,同学录,朋友圈等等,后续页面还是开发中。写这个项目主要目的是练习和熟悉vue和vuex的配合使用,利用socket.io实现实时聊...
摘要:使用即可完成一个很有意思的在线游戏作品。你画我猜,相信大家对这个游戏都很熟悉。我用实现了你画我猜这个游戏。可以修改画笔颜色,粗细,进行撤销,恢复,清空等操作。第一个猜完后,游戏时间缩短为秒。 使用 websocket + vue2 即可完成一个很有意思的在线游戏作品。你画我猜,相信大家对这个游戏都很熟悉。 我用Vue2 + mint-ui + nodejs + websocket ...
摘要:官网地址聊天机器人插件开发实例教程一创建插件在系统技巧使你的更加专业前端掘金一个帮你提升技巧的收藏集。我会简单基于的简洁视频播放器组件前端掘金使用和实现购物车场景前端掘金本文是上篇文章的序章,一直想有机会再次实践下。 2道面试题:输入URL按回车&HTTP2 - 掘金通过几轮面试,我发现真正那种问答的技术面,写一堆项目真不如去刷技术文章作用大,因此刷了一段时间的博客和掘金,整理下曾经被...
摘要:五六月份推荐集合查看最新的请点击集前端最近很火的框架资源定时更新,欢迎一下。苏幕遮燎沈香宋周邦彦燎沈香,消溽暑。鸟雀呼晴,侵晓窥檐语。叶上初阳乾宿雨,水面清圆,一一风荷举。家住吴门,久作长安旅。五月渔郎相忆否。小楫轻舟,梦入芙蓉浦。 五、六月份推荐集合 查看github最新的Vue weekly;请::点击::集web前端最近很火的vue2框架资源;定时更新,欢迎 Star 一下。 苏...
阅读 3947·2023-04-25 19:07
阅读 3654·2021-11-22 12:02
阅读 3208·2021-10-12 10:11
阅读 4223·2021-09-03 10:49
阅读 2969·2019-08-30 13:21
阅读 3105·2019-08-30 11:14
阅读 2162·2019-08-29 15:40
阅读 2957·2019-08-28 18:29