Skip to content

Commit 6d86cc7

Browse files
committed
update to 1.2.1
1 parent a968141 commit 6d86cc7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+593
-668
lines changed

.eslintrc

Lines changed: 0 additions & 177 deletions
This file was deleted.

.eslintrc.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"plugins": ["vue"],
8+
"extends": "eslint:recommended",
9+
"parserOptions": {
10+
"sourceType": "module",
11+
"ecmaVersion": 7,
12+
"ecmaFeatures": {
13+
"globalReturn": true,
14+
"impliedStrict": true,
15+
"experimentalObjectRestSpread":true,
16+
"jsx": false
17+
}
18+
},
19+
"rules": {
20+
"indent": [
21+
"error",
22+
2
23+
],
24+
"linebreak-style": [
25+
"error",
26+
"unix"
27+
],
28+
"quotes": [
29+
"error",
30+
"single"
31+
],
32+
"semi": [
33+
"error",
34+
"never"
35+
],
36+
"no-unused-vars": ["error", { "vars": "all", "args": "none" }],
37+
"no-mixed-spaces-and-tabs": [0, "smart-tabs"]
38+
}
39+
}

History.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
1.2.1 / 2016-04-08
2+
==================
3+
4+
* 更新vue 到 1.0.21
5+
* 更新vue-router 到 0.7.13
6+
* 更新vue-validator 到 2.0.1
7+
* 更新jackblog-sass 到 1.0.4
8+
* 增加eslint代码检查
9+
10+
111
1.2.0 / 2016-03-15
212
==================
313

README.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,55 @@
11
# Jackblog Vue 版
2+
[![Dependency Status](https://david-dm.org/jackhutu/jackblog-vue.svg)](https://david-dm.org/jackhutu/jackblog-vue)
3+
[![devDependency Status](https://david-dm.org/jackhutu/jackblog-vue/dev-status.svg)](https://david-dm.org/jackhutu/jackblog-vue#info=devDependencies)
24

3-
Jackblog 是使用 Node.js + MongoDB + 其它客户端框架开发的个人博客系统,前后端分离,仿简书模板.此为客户端 Vue版
4-
服务端有:
5-
[express 版](https://github.com/jackhutu/jackblog-api-express)
6-
[koa 版](https://github.com/jackhutu/jackblog-api-koa)
7-
客户端有:
8-
[angular1.x 版](https://github.com/jackhutu/jackblog-angular1)
9-
[angular2.x 版](https://github.com/jackhutu/jackblog-angular2)
10-
[react redux 版](https://github.com/jackhutu/jackblog-react-redux)
11-
[vue 版](https://github.com/jackhutu/jackblog-vue)
12-
移动端有:
13-
[react native 版](https://github.com/jackhutu/jackblog-react-native-redux)
5+
Jackblog 是使用 Node.js + MongoDB + 其它客户端框架开发的个人博客系统,前后端分离,仿简书模板.
6+
服务端有: [express 版](https://github.com/jackhutu/jackblog-api-express) , [koa 版](https://github.com/jackhutu/jackblog-api-koa)
7+
客户端有: [angular1.x 版](https://github.com/jackhutu/jackblog-angular1) , [angular2.x 版](https://github.com/jackhutu/jackblog-angular2) , [react redux 版](https://github.com/jackhutu/jackblog-react-redux) , [vue 版](https://github.com/jackhutu/jackblog-vue)
8+
移动端有: [react native 版](https://github.com/jackhutu/jackblog-react-native-redux), [ionic2.0 版](https://github.com/jackhutu/jackblog-ionic2)
9+
##### 此为客户端vue版, 需要配合服务端使用.
10+
11+
> 服务端任选一种, 请预先安装并启动服务端
1412
1513

1614
## 开发
1715

1816
```
17+
$ git clone [email protected]:jackhutu/jackblog-vue.git
18+
$ cd jackblog-vue
1919
$ npm install
2020
$ gulp serve
2121
```
2222

23-
## 打包
23+
### 目录结构
24+
25+
```
26+
.
27+
├── README.md
28+
├── dist // 项目build目录
29+
├── logs // 生产环境日志目录
30+
├── src // 生产目录
31+
│ ├── api // API 请求
32+
│ ├── assets // css 和图片资源
33+
│ ├── components // 组件
34+
│ ├── utils // 工具函数
35+
│ └── vuex // vuex相关文件, store,action
36+
│ └── config.js // api url, cookie domain等配置文件
37+
│ └── index.html // 主页html
38+
│ └── routes.js // 路由配置
39+
│ └── index.js // 入口文件
40+
├── .babelrc // babel配置
41+
├── .eslintrc.json // eslint配置
42+
├── gulpfile.babel.js // gulp配置, 使用gulp做为任务管理
43+
├── History.md // 更新日志
44+
├── process.json // pm2配置文件
45+
├── server.js // 生产环境启动server
46+
├── webpack.config.dev.js // 开发环境Webpack配置文件
47+
├── webpack.config.js // Webpack 配置文件
48+
├── webpack-config.prod.js // 生产环境Webpack 配置文件
49+
.
50+
```
51+
52+
## 生产环境构建
2453

2554
```
2655
$ gulp build 或 gulp serve:dist
@@ -30,7 +59,7 @@ $ gulp build 或 gulp serve:dist
3059
```
3160
$ pm2 start process.json
3261
```
33-
可参考[利用git和pm2一键布署项目到vps](http://angular1.jackhu.top/article/55cd8e00c6e998b817a930c7)
62+
可参考[利用git和pm2一键布署项目到vps](http://jackhu.top/article/55cd8e00c6e998b817a930c7)
3463

3564
## License
3665
MIT

gulpfile.babel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const DEV_PORT = 5100,PROD_PORT = 8400
1313
gulp.task('serve', cb =>{
1414
let webpackConfig = require('./webpack.config')
1515
let myConfig = Object.create(webpackConfig)
16+
myConfig.entry.unshift('webpack/hot/only-dev-server')
1617
myConfig.entry.unshift('webpack-dev-server/client?http://localhost:' + DEV_PORT)
1718
new WebpackDevServer(webpack(myConfig), {
1819
noInfo: false,

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
"bootstrap": "^3.3.6",
3535
"css-loader": "^0.23.1",
3636
"del": "^2.2.0",
37-
"eslint": "^2.4.0",
37+
"eslint": "^2.7.0",
38+
"eslint-loader": "^1.3.0",
39+
"eslint-plugin-vue": "^0.1.1",
3840
"extract-text-webpack-plugin": "^1.0.1",
3941
"file-loader": "^0.8.5",
4042
"font-awesome": "^4.5.0",
@@ -43,23 +45,23 @@
4345
"gulp-nodemon": "^2.0.6",
4446
"gulp-sequence": "^0.4.5",
4547
"gulp-util": "^3.0.7",
46-
"html-webpack-plugin": "^2.10.0",
48+
"html-webpack-plugin": "^2.15.0",
4749
"image-webpack-loader": "^1.6.3",
48-
"jackblog-sass": "^1.0.3",
50+
"jackblog-sass": "^1.0.4",
4951
"open": "0.0.5",
5052
"react-cookie": "^0.4.5",
51-
"style-loader": "^0.13.0",
53+
"style-loader": "^0.13.1",
5254
"url-loader": "^0.5.7",
53-
"vue": "^1.0.17",
55+
"vue": "^1.0.21",
5456
"vue-hot-reload-api": "^1.3.2",
55-
"vue-html-loader": "^1.2.0",
56-
"vue-loader": "^8.2.0",
57+
"vue-html-loader": "^1.2.2",
58+
"vue-loader": "^8.2.2",
5759
"vue-resource": "^0.7.0",
58-
"vue-router": "^0.7.11",
60+
"vue-router": "^0.7.13",
5961
"vue-strap": "^1.0.7",
6062
"vue-style-loader": "^1.0.0",
6163
"vue-toastr": "^1.0.3",
62-
"vue-validator": "^2.0.0-beta.2",
64+
"vue-validator": "^2.0.1",
6365
"vuex": "^0.6.2",
6466
"vuex-router-sync": "^1.0.0",
6567
"webpack": "^1.12.14",

src/api/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
import {UserResource,AuthResource,ArticleResource,TagResource,MobileResource,CommentResource} from './resources'
24

35
export default {

src/api/resources.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
'use strict'
2+
13
import Vue from 'vue'
24
import VueResource from 'vue-resource'
35
import {API_ROOT} from '../config'
4-
import { saveCookie,getCookie,signOut } from '../utils/authService'
6+
import { getCookie,signOut } from '../utils/authService'
57

68
Vue.use(VueResource)
79

@@ -12,9 +14,9 @@ Vue.http.options.xhr = {withCredentials: true}
1214
Vue.http.interceptors.push({
1315
request (request) {
1416
// 这里对请求体进行处理
15-
request.headers = request.headers || {};
17+
request.headers = request.headers || {}
1618
if (getCookie('token')) {
17-
request.headers.Authorization = 'Bearer ' + getCookie('token').replace(/(^\")|(\"$)/g, "");
19+
request.headers.Authorization = 'Bearer ' + getCookie('token').replace(/(^\")|(\"$)/g, '')
1820
}
1921
return request
2022
},

0 commit comments

Comments
 (0)