Skip to content

Commit

Permalink
样式及bug更新
Browse files Browse the repository at this point in the history
  • Loading branch information
doramart committed Oct 9, 2017
1 parent d1260c7 commit 99a6207
Show file tree
Hide file tree
Showing 75 changed files with 1,482 additions and 989 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# doracms 2.0.0

![DoraCMS](http://git.oschina.net/uploads/images/2015/0930/174726_d78c4a23_352304.jpeg "DoraCMS")
![DoraCMS](http://7xkrk4.com1.z0.glb.clouddn.com/doracms2.jpg "DoraCMS")

## 2.0.0版本更新
1、生产环境日志目录可配置,修复用户部署生产报路径找不到的问题
2、新增广告管理模块,修复多图轮播显示不正常的问题
3、修复删除文章没有同步删除关联留言的问题
4、更新前端后台样式
5、修复留言过滤特殊字符的问题
6、添加了留言回复功能
7、修复文章上传缩略图某些jpg文件无法上传的问题
8、完善了后台首页信息总览
9、修复了后台修改其它管理员权限会把自己的权限置空的问题

更新方法:
1、checkout 最新 2.0.0 代码
2、删除 node_modules,重新安装依赖包
3、找到 utils/settings.js,将 SYSTEMLOGPATH 参数值修改为正式服务器上(生产环境)的日志目录(very important!)
3、启动数据库,执行npm run dev

## 说明

Expand Down
3 changes: 2 additions & 1 deletion configs/logConfig.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
let path = require('path');
const { settings } = require('../utils');

//日志根目录

let isDevEnv = (process.env.NODE_ENV == 'development' || process.env.NODE_ENV == 'FAT') ? true : false;
let baseLogPath = isDevEnv ? path.resolve(__dirname, '../logs') : '/home/doraData/logsdir/doracms';
let baseLogPath = isDevEnv ? path.resolve(__dirname, '../logs') : settings.SYSTEMLOGPATH;
//错误日志目录
let errorPath = "/error";
//错误日志文件名
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "doracms",
"version": "2.0.0beta",
"version": "2.0.0",
"description": "基于nodejs,express,vue2 内容管理系统.",
"keywords": [
"vue",
Expand Down Expand Up @@ -29,7 +29,7 @@
"cross-env": "^5.0.0",
"crypto": "0.0.3",
"ejs": "^2.5.6",
"element-ui": "^1.4.2",
"element-ui": "^2.0.0-alpha.2",
"express": "^4.15.0",
"express-http-proxy": "^1.0.3",
"express-session": "^1.15.3",
Expand All @@ -52,12 +52,12 @@
"store2": "^2.5.1",
"ueditor": "^1.2.2",
"validator": "^7.0.0",
"vue": "^2.3.3",
"vue": "^2.4.4",
"vue-meta": "^1.0.2",
"vue-router": "^2.5.3",
"vue-server-renderer": "^2.3.3",
"vue-server-renderer": "^2.4.4",
"vue-ssr-html-stream": "^2.2.0",
"vue-template-compiler": "^2.3.3",
"vue-template-compiler": "^2.4.4",
"vuex": "^2.3.1",
"vuex-router-sync": "^4.1.2"
},
Expand Down
3 changes: 0 additions & 3 deletions server/lib/controller/adminGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ class AdminGroup {
const item_id = fields._id;
try {
await AdminGroupModel.findOneAndUpdate({ _id: item_id }, { $set: userObj });
// 更新power
req.session.adminPower = userObj.power;
req.session.adminUserInfo.group.power = userObj.power;
res.send({
state: 'success'
});
Expand Down
12 changes: 11 additions & 1 deletion server/lib/controller/adminUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,24 @@ class AdminUser {
try {
let adminUserCount = await AdminUserModel.count();
let regUserCount = await UserModel.count();
let regUsers = await UserModel.find({}).limit(20).sort({date: -1});
let contentCount = await ContentModel.count();
let messageCount = await MessageModel.count();
let messages = await MessageModel.find().limit(10).sort({date: -1}).populate([{
path: 'contentId',
select: 'stitle _id'
}, {
path: 'author',
select: 'userName _id enable date logo'
}]).populate('replyAuthor').populate('adminAuthor').exec();
res.send({
state: 'success',
adminUserCount,
regUserCount,
regUsers,
contentCount,
messageCount
messageCount,
messages
});
} catch (error) {
logUtil.error(err, req);
Expand Down
2 changes: 2 additions & 0 deletions server/lib/controller/ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class Ads {
const adObj = {
name: fields.name,
state: fields.state,
height: fields.height,
type: fields.type,
comments: fields.comments
}
Expand Down Expand Up @@ -150,6 +151,7 @@ class Ads {
const userObj = {
name: fields.name,
state: fields.state,
height: fields.height,
type: fields.type,
comments: fields.comments
}
Expand Down
11 changes: 8 additions & 3 deletions server/lib/controller/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,16 @@ class Content {
files = {
id: 1,
title: 1,
stitle: 1
sImg: 1,
stitle: 1,
updateDate: 1
}
} else if (model === 'normal') {
files = {
id: 1,
title: 1,
sImg: 1,
isTop: 1,
categories: 1,
commentNum: 1,
date: 1,
Expand All @@ -109,7 +112,7 @@ class Content {
},
{
path: 'categories',
select: 'name _id'
select: 'name defaultUrl _id'
}, {
path: 'tags',
select: 'name _id'
Expand Down Expand Up @@ -288,6 +291,8 @@ class Content {
})
}
await ContentModel.remove({ _id: req.query.ids });
// 删除关联留言
await MessageModel.remove({ 'contentId': { $in: req.query.ids } });
res.send({
state: 'success'
});
Expand All @@ -296,7 +301,7 @@ class Content {
res.send({
state: 'error',
type: 'ERROR_IN_SAVE_DATA',
message: '删除数据失败:',
message: '删除数据失败:' + err,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/lib/controller/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Message {
if (fields.utype === '1') {
mailParams.adminAuthor = req.session.adminUserInfo
} else {
mailParams.author = replyAuthor.author
mailParams.author = msgInfo.replyAuthor.author
}
service.sendEmail(req, systemConfigs[0], settings.email_notice_user_contentMsg, mailParams);
}
Expand Down
1 change: 1 addition & 0 deletions server/lib/models/Ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var AdsSchema = new Schema({
name: String,
type: { type: String, default: "0" }, // 展示形式 0文字 1图片 2友情链接
state: { type: Boolean, default: true }, // 广告状态,是否显示
height: { type: Number, default: 50 },
date: { type: Date, default: Date.now },
items: [{ type: String, ref: 'AdsItems' }], // 广告列表id
comments: String, // 描述
Expand Down
14 changes: 7 additions & 7 deletions server/lib/models/AdsItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ var AdsItemsSchema = new Schema({
'default': shortid.generate
},

title: String,
link : String, // 广告链接
width : Number,
height : Number,
target : {type : String, default : '_blank'},
sImg : String , // 图片路径
title: String,
link: String, // 广告链接
width: Number,
height: { type: Number, default: 1 },
target: { type: String, default: '_blank' },
sImg: String, // 图片路径
date: { type: Date, default: Date.now },
alt: String // 广告alt标识
});

var AdsItems = mongoose.model("AdsItems",AdsItemsSchema);
var AdsItems = mongoose.model("AdsItems", AdsItemsSchema);

module.exports = AdsItems;

2 changes: 1 addition & 1 deletion server/lib/models/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ContentSchema.path('date').get(function (v) {
return moment(v).startOf('hour').fromNow();
});
ContentSchema.path('updateDate').get(function (v) {
return moment(v).format("YYYY-MM-DD HH:mm:ss");
return moment(v).format("YYYY-MM-DD HH:mm");
});

var Content = mongoose.model("Content", ContentSchema);
Expand Down
2 changes: 1 addition & 1 deletion src/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Vue from 'vue'
import App from './manage/App.vue'
import router from './manage/router'
import ElementUI from 'element-ui'
import '../node_modules/element-ui/lib/theme-default/index.css'
import '../node_modules/element-ui/lib/theme-chalk/index.css'
import '../node_modules/font-awesome/css/font-awesome.min.css'
import './manage/assets/styles/public.css';
import Axios from 'axios';
Expand Down
2 changes: 1 addition & 1 deletion src/entry-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createApp } from './app'
import ProgressBar from './index/components/ProgressBar.vue'

import "./index/assets/base.css"
import '../node_modules/element-ui/lib/theme-default/index.css'
import '../node_modules/element-ui/lib/theme-chalk/index.css'
import '../node_modules/font-awesome/css/font-awesome.min.css'

// 全局的进度条,在组件中可通过 $loading 访问
Expand Down
57 changes: 28 additions & 29 deletions src/index/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ html, body {
margin: 0;
background: #ffffff;
-webkit-font-smoothing: antialiased;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
color: rgb(51, 51, 51);
font-family: -apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif;
}

.fade-enter-active, .fade-leave-active {
Expand All @@ -16,11 +17,11 @@ html, body {

a:link, a:active, a:visited {
text-decoration: none;
color: #6e7173;
color: #333333;
}

a:hover {
color: #20A0FF
color: #409EFF
}

ul {
Expand All @@ -32,6 +33,13 @@ li {
list-style-type: none;
}

.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}

h2 {
font-size: 18px;
}
Expand All @@ -51,7 +59,7 @@ pre {
word-wrap: break-word;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-left: 2px solid #20A0FF;
border-left: 2px solid #409EFF;
border-radius: 0px;
overflow: auto;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
Expand All @@ -75,42 +83,21 @@ pre {
}

.normaltitle span {
background-color: #20A0FF;
background-color: #409EFF;
height: 30px;
line-height: 30px;
padding: 2px 12px;
display: inline-block;
}

.catetitle {
color: #6e7173;
}

.simpletitle {
color: #6e7173;
font-weight: 100;
margin: 0;
}

.pannel-title {
/*font-size: 14px;*/
margin: 0;
margin-bottom: 15px;
border-bottom: 1px solid #f1f1f1;
}

.pannel-title span {
color: #20A0FF;
border-bottom: 1px solid #20A0FF;
display: inline-block;
padding: 5px 0;
margin-bottom: -1px;
color: #333333;
}

.login-form {
margin: 0 auto;
margin-top: 6%;
margin-bottom: 100px;
padding-top: 6%;
padding-bottom: 100px;
}

.login-form .submit-btn {
Expand All @@ -121,6 +108,8 @@ pre {
background-clip: padding-box;
padding: 25px 35px 10px 35px;
background: #fff;
box-shadow: 0 0 8px rgba(0,0,0,.1);
border-radius: 4px;
}

.login-form .login-container .title {
Expand Down Expand Up @@ -151,6 +140,9 @@ pre {
.login-pannel {
display: none;
}
.search-pannel {
display: none !important;
}
.content-tag {
display: none;
}
Expand All @@ -161,12 +153,19 @@ pre {
.content-item .contentImg {
display: none !important;
}

.content-item .post-angle{
display: none !important;
}
.content-mainbody-right {
display: none;
}
}

@media screen and (max-width:992px) {
.content-item .post-angle{
display: none !important;
}
.content-item .contentImg {
display: none !important;
}
Expand Down
5 changes: 2 additions & 3 deletions src/index/components/AdsPannel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<a :href="ads.data.items[0].link" target="_blank"><img :src="ads.data.items[0].sImg" :alt="ads.data.items[0].alt" /></a>
</div>
<div v-else>
<el-carousel indicator-position="outside">
<el-carousel :height="ads.data.height+'px'">
<el-carousel-item v-for="item in ads.data.items" :key="item._id">
<h3>
<a :href="item.link" target="_blank"><img :src="item.sImg" :alt="item.alt" /></a>
<a :href="item.link" target="_blank"><img :height="ads.data.height+'px'" :src="item.sImg" :alt="item.alt" /></a>
</h3>
</el-carousel-item>
</el-carousel>
Expand Down Expand Up @@ -47,7 +47,6 @@ export default {
color: #475669;
font-size: 18px;
opacity: 0.75;
line-height: 300px;
margin: 0;
}
Expand Down
Loading

0 comments on commit 99a6207

Please sign in to comment.