Skip to content

Commit 4bed888

Browse files
committed
refine
1 parent 0da4e5e commit 4bed888

File tree

8 files changed

+22
-25
lines changed

8 files changed

+22
-25
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33

44
[English Document](https://github.com/PanJiaChen/vue-element-admin/blob/master/README-en.md)
55

6+
[wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
7+
68
## 前言
79
> 这半年来一直在用vue写管理后台,目前后台已经有七十多个页面,十几种权限,但维护成本依然很低,所以准备开源分享一下后台开发的经验和成果。目前的技术栈主要的采用vue+element+axios.由于是个人项目,所以数据请求都是用了mockjs代替。注意:在次项目基础上改造开发时请移除mock文件,不然所有请求都将会被代理掉!注意!
810
911
后续会出一系列的教程配套文章,如如何从零构建后台项目框架,如何做完整的用户系统(如权限验证,二次登录等),如何二次开发组件(如富文本),如何整合七牛等等文章,各种后台开发经验等等。莫急~~
1012

1113
相应需求,开了一个qq群 591724180 方便大家交流
1214

15+
- [wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
1316
- [手摸手,带你用 vue 撸后台 系列一](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
1417
- [ 手摸手,带你封装一个vue component](https://segmentfault.com/a/1190000009090836)
15-
- [wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
16-
18+
19+
1720
**如有问题请先看上述问题和Wiki,不能满足,欢迎issue和pr~**
1821

1922
## 功能

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"mockjs": "1.0.1-beta3",
2626
"normalize.css": "3.0.2",
2727
"nprogress": "0.2.0",
28-
"showdown": "1.6.4",
2928
"simplemde": "1.11.2",
3029
"sortablejs": "1.5.1",
3130
"vue": "2.2.6",
@@ -38,7 +37,6 @@
3837
},
3938
"devDependencies": {
4039
"autoprefixer": "6.7.2",
41-
"axios-mock-adapter": "1.8.1",
4240
"babel-core": "6.22.1",
4341
"babel-eslint": "7.1.1",
4442
"babel-loader": "6.2.10",
@@ -79,7 +77,7 @@
7977
"vue-loader": "12.0.4",
8078
"vue-style-loader": "2.0.5",
8179
"vue-template-compiler": "2.2.6",
82-
"webpack": "2.2.3",
80+
"webpack": "2.5.1",
8381
"webpack-bundle-analyzer": "2.2.1",
8482
"webpack-dashboard": "0.2.1",
8583
"webpack-dev-middleware": "1.10.0",

src/router/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ const Permission = resolve => require(['../views/permission/index'], resolve);
6464
Vue.use(Router);
6565

6666
/**
67-
* icon :the icon show in the sidebar
68-
* hidden: if hiddenLtrue will not show in the sidebar
69-
* redirect :if redirect:noredirect will not redirct in the levelbar
67+
* icon : the icon show in the sidebar
68+
* hidden : if hidden:true will not show in the sidebar
69+
* redirect : if redirect:noredirect will not redirct in the levelbar
7070
* noDropdown : if noDropdown:true will not has submenu
71-
* meta: { role: ['admin'] } will control the page role
71+
* meta : { role: ['admin'] } will control the page role
7272
*/
7373
export default new Router({
7474
// mode: 'history', //后端支持可开

src/store/modules/user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const user = {
7979
},
8080

8181

82-
// 获取用户信息
82+
// 获取用户信息
8383
GetInfo({ commit, state }) {
8484
return new Promise((resolve, reject) => {
8585
getInfo(state.token).then(response => {
@@ -125,7 +125,7 @@ const user = {
125125
});
126126
},
127127

128-
// 前端 登出
128+
// 前端 登出
129129
FedLogOut({ commit }) {
130130
return new Promise(resolve => {
131131
commit('SET_TOKEN', '');

src/styles/mixin.scss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,22 @@
3737
$transparent-border-style: $width solid transparent;
3838
height: 0;
3939
width: 0;
40-
@if $direction == up {
40+
@if $direction==up {
4141
border-bottom: $color-border-style;
4242
border-left: $transparent-border-style;
4343
border-right: $transparent-border-style;
44-
} @else if $direction == right {
44+
}
45+
@else if $direction==right {
4546
border-left: $color-border-style;
4647
border-top: $transparent-border-style;
4748
border-bottom: $transparent-border-style;
48-
} @else if $direction == down {
49+
}
50+
@else if $direction==down {
4951
border-top: $color-border-style;
5052
border-left: $transparent-border-style;
5153
border-right: $transparent-border-style;
52-
} @else if $direction == left {
54+
}
55+
@else if $direction==left {
5356
border-right: $color-border-style;
5457
border-top: $transparent-border-style;
5558
border-bottom: $transparent-border-style;

src/utils/fetch.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const service = axios.create({
1212
// request拦截器
1313
service.interceptors.request.use(config => {
1414
// Do something before request is sent
15-
console.log(store.getters.token)
1615
if (store.getters.token) {
1716
config.headers['X-Token'] = store.getters.token; // 让每个请求携带token--['X-Token']为自定义key 请根据实际情况自行修改
1817
}
@@ -28,9 +27,8 @@ service.interceptors.response.use(
2827
response => response
2928
/**
3029
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
31-
* 如通过htmlrequest 状态码标示 逻辑可写在下面error中
30+
* 如通过xmlhttprequest 状态码标识 逻辑可写在下面error中
3231
*/
33-
3432
// const code = response.data.code;
3533
// // 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token
3634
// if (code === 50008 || code === 50014 || code === 50012) {

src/utils/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* Created by jiachenpan on 16/11/18.
33
*/
4-
import showdown from 'showdown' // markdown转化
5-
const converter = new showdown.Converter();
64

75
export function parseTime(time, cFormat) {
86
if (arguments.length === 0) {
@@ -214,6 +212,3 @@
214212
}
215213
}
216214

217-
export function showdownMD(md) {
218-
return converter.makeHtml(md)
219-
}

src/views/example/table.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@
321321
},
322322
handleFetchPv(pv) {
323323
fetchPv(pv).then(response => {
324-
this.pvData = response.pvData
325-
this.dialogPvVisible = true
324+
this.pvData = response.data.pvData;
325+
this.dialogPvVisible = true;
326326
})
327327
},
328328
handleDownload() {

0 commit comments

Comments
 (0)