Skip to content

Commit

Permalink
sass fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ciqulover committed Dec 1, 2016
1 parent fe09243 commit 0fe677e
Show file tree
Hide file tree
Showing 24 changed files with 223 additions and 180 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Expand Up @@ -13,6 +13,10 @@ module.exports = {
'generator-star-spacing': 0,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-console': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-return-assign':0
'no-return-assign': 0,
'space-before-function-paren': 0,
'space-before-blocks': 0,
'no-multi-spaces': 0,
'no-extend-native': 1
}
}
104 changes: 67 additions & 37 deletions README.md
Expand Up @@ -3,7 +3,7 @@
> 一个前端基于Vue.js,后端基于Node.js的博客内容管理器
> 此分支是Vue2.0版, 1.0版在[这里](https://github.com/ycwalker/CMS-of-Blog/tree/vue1.0)
> 此分支是Vue2.0版 [1.0版](https://github.com/ycwalker/CMS-of-Blog/tree/vue1.0)
### [Demo](http://115.28.90.175/)

Expand All @@ -30,47 +30,60 @@
* SASS

## Directory
```
dist/ 打包后生成
server/ 后端
api.js Restful接口
db.js 数据库
index.js 服务器入口
init.json 初始数据
src/
assets/ 外部引用文件
components/ vue组件
back/ 博客控制台组件
front/ 博客页面组件
share/ 公共组件
StyleInjector.vue 注入style
router/ 路由
store/ vuex文件
style/ 全局样式
main.js 项目入口文件
setup.js 初始化账户
index.html 单页应用
setup.html 初始化账户页面

.babelrc babel配置
webpack.config.js webpack配置
```
│ .babelrc babel配置
│ .editorconfig
│ .eslintignore
│ .eslintrc.js eslintrc配置
│ .gitignore
│ index.html 入口页面
│ package.json
│ README.md
│ setup.html 初始化账户页面
│ webpack.config.js webpack配置
├─dist 打包生成
├─server 服务端
│ api.js Restful接口
│ db.js 数据库
│ index.js
│ init.json 初始数据
└─src
│ main.js 项目入口
│ setup.js 初始化账户
├─assets 外部引用文件
│ ├─css
│ ├─fonts
│ ├─img
│ └─js
├─components vue组件
│ ├─back 博客控制台组件
│ ├─front 博客页面组件
│ └─share 公共组件
├─router 路由
├─store vuex文件
└─style 全局样式
```


## Setup
####环境
* Node.js **v6+**
* mongoDB [Download](https://www.mongodb.com/download-center?jmp=nav#community)mongoDB安装完成,建立数据库文件夹。以win平台为例,在C盘下新建data文件夹,进入data文件夹新建db文件夹(这是mongoDB启动时默认的数据存储目录,如果建立在其他盘上,需要在启动时通过--dbpath参数指定目录。注意mongoDB不会自动创建这个目录,如果没有目录启动时会错误)
进入mongoDB的安装目录,一般在C:\Program Files\MongoDB\Server\3.2\bin(因版本而异)
进入bin目录后,从终端启动目录下的mongod.exe(win可以按住shift右击空白处从当前目录打开命令行)
```
.\mongod.exe
* Node.js **v6**
* mongoDB [Download](https://www.mongodb.com/download-center?jmp=nav#community)
[安装方法](https://docs.mongodb.com/manual/installation/)

安装完成并建立数据库文件夹后,启动mongdb
``` bash
mongod
```
可以在控制台看到waiting for connections on port 27017

克隆远程库
```
Expand All @@ -83,14 +96,28 @@ cd CMS-of-Blog
安装依赖
```
npm install
```
打包生成 (已经打包dist目录,可以省略)
```
npm run build
```
运行服务器
```
npm run server
npm start
```
打开浏览器输入http://localhost:3000/
打开账户建立页面,建立完毕,登入管理器

开发
```
npm run dev
```
Eslint
```$xslt
npm run lint
```

##### Notice
* server目录下的init.json,初始化数据放在该文件中。
* 推荐[MongoChef](http://3t.io/mongochef/)作为mongoDB可视化管理工具
Expand All @@ -106,3 +133,6 @@ npm run server
* [ ] 主题设置
* [x] 密码修改
* [ ] 博客简介主页

## Licence
MIT
5 changes: 5 additions & 0 deletions dist/index.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/index.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions dist/main.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/setup.js

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions dist/styles.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions index.html
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>cms2simple</title>
<link rel="stylesheet" href="dist/index.css">
<link rel="stylesheet" href="dist/styles.css">
</head>
<body>
Expand Down
12 changes: 9 additions & 3 deletions package.json
@@ -1,15 +1,19 @@
{
"name": "CMS2",
"description": "CMS of Blog V2.0.0, Powered by Vue2.0",
"version": "2.1.0",
"version": "2.1.1",
"author": "Lei Jiang <ycwalker@outlook.com>",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
"server": "node ./server/index",
"start": "node ./server/index",
"lint": "eslint --ext .js,.vue .",
"fix": "eslint --fix --ext .js,.vue ."
},
"engines": {
"node": ">=6.0",
"npm": ">=3.0"
},
"dependencies": {
"babel-eslint": "^7.1.1",
"body-parser": "^1.15.2",
Expand Down Expand Up @@ -39,6 +43,7 @@
"node-sass": "^3.10.1",
"sass": "^0.5.0",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"vue": "^2.0.1",
"vue-loader": "^9.7.0",
Expand All @@ -47,5 +52,6 @@
"vuex": "^2.0.0",
"webpack": "^2.1.0-beta.25",
"webpack-dev-server": "^2.1.0-beta.0"
}
},
"licence": "MIT"
}
1 change: 1 addition & 0 deletions server/index.js
Expand Up @@ -32,6 +32,7 @@ app.post('/api/setup', function (req, res) {
app.get('*', function (req, res) {
const fileName = db.initialized ? 'index.html' : 'setup.html'
const html = fs.readFileSync(resolve('../' + fileName), 'utf-8')
// const html = fs.readFileSync(resolve('../setup.html'), 'utf-8')
res.send(html)
})

Expand Down
2 changes: 1 addition & 1 deletion setup.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Set up</title>
<link rel="stylesheet" href="dist/styles.css">
<link rel="stylesheet" href="dist/index.css">
<style>
.form {
width: 500px;
Expand Down
3 changes: 0 additions & 3 deletions src/components/StyleInjector.vue

This file was deleted.

9 changes: 3 additions & 6 deletions src/components/back/Login.vue
Expand Up @@ -49,7 +49,7 @@
this.login({name: this.name, pwd: this.pwd})
.then(() => {
const date = new Date(Date.now() + 60000 * 30)
set('user', this.name, date, '/', location.hostname)
set('user', this.name, date, '/', window.location.hostname)
this.$router.push({path: '/console'})
})
.catch(msg => this.info = msg)
Expand All @@ -61,17 +61,14 @@
},
watch: {
name: 'clearInfo',
pwd: 'clearInfo'
pwd: 'clearInfo'
}
}
</script>
<style lang="sass" rel="stylesheet/scss">
<style lang="sass" rel="stylesheet/scss" scoped>
@import "../../style/variables";
section.login {
position: relative;
height: 100%;
min-height: 500px;
.form {
width: 500px;
height: 400px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/back/StatusBar.vue
Expand Up @@ -18,7 +18,7 @@
</template>
<script>
import {unset} from '../../assets/js/cookieUtil'
import {mapState,mapMutations} from 'vuex'
import {mapState, mapMutations} from 'vuex'
export default{
methods: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/front/Article.vue
Expand Up @@ -30,14 +30,14 @@
this.$store.dispatch('getArticle', this.$route.query.id)
},
highlight(){
setTimeout(()=> {
setTimeout(() => {
hljs.initHighlighting.called = false
hljs.initHighlighting()
}, 0)
}
},
computed: mapState({
article: state=> {
article: state => {
state.article.content = marked(state.article.content || '')
return state.article
}
Expand Down

0 comments on commit 0fe677e

Please sign in to comment.