From 4bed888e9d1669c2b00dfc7fbd50c4cfac52eeee Mon Sep 17 00:00:00 2001 From: Pan <panfree23@gmail.com> Date: Tue, 16 May 2017 11:08:17 +0800 Subject: [PATCH] refine --- README.md | 7 +++++-- package.json | 4 +--- src/router/index.js | 8 ++++---- src/store/modules/user.js | 4 ++-- src/styles/mixin.scss | 11 +++++++---- src/utils/fetch.js | 4 +--- src/utils/index.js | 5 ----- src/views/example/table.vue | 4 ++-- 8 files changed, 22 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index d60e7b07..3a292193 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [English Document](https://github.com/PanJiaChen/vue-element-admin/blob/master/README-en.md) +[wiki](https://github.com/PanJiaChen/vue-element-admin/wiki) + ## å‰è¨€ > è¿™åŠå¹´æ¥ä¸€ç›´åœ¨ç”¨vue写管ç†åŽå°ï¼Œç›®å‰åŽå°å·²ç»æœ‰ä¸ƒå多个页é¢ï¼Œåå‡ ç§æƒé™ï¼Œä½†ç»´æŠ¤æˆæœ¬ä¾ç„¶å¾ˆä½Žï¼Œæ‰€ä»¥å‡†å¤‡å¼€æºåˆ†äº«ä¸€ä¸‹åŽå°å¼€å‘çš„ç»éªŒå’Œæˆæžœã€‚ç›®å‰çš„æŠ€æœ¯æ ˆä¸»è¦çš„采用vue+element+axios.由于是个人项目,所以数æ®è¯·æ±‚都是用了mockjs代替。注æ„ï¼šåœ¨æ¬¡é¡¹ç›®åŸºç¡€ä¸Šæ”¹é€ å¼€å‘时请移除mock文件,ä¸ç„¶æ‰€æœ‰è¯·æ±‚都将会被代ç†æŽ‰ï¼æ³¨æ„ï¼ @@ -10,10 +12,11 @@ 相应需求,开了一个qq群 591724180 æ–¹ä¾¿å¤§å®¶äº¤æµ + - [wiki](https://github.com/PanJiaChen/vue-element-admin/wiki) - [æ‰‹æ‘¸æ‰‹ï¼Œå¸¦ä½ ç”¨ vue æ’¸åŽå° 系列一](https://juejin.im/post/59097cd7a22b9d0065fb61d2) - [ æ‰‹æ‘¸æ‰‹ï¼Œå¸¦ä½ å°è£…一个vue component](https://segmentfault.com/a/1190000009090836) - - [wiki](https://github.com/PanJiaChen/vue-element-admin/wiki) - + + **如有问题请先看上述问题和Wiki,ä¸èƒ½æ»¡è¶³ï¼Œæ¬¢è¿Žissueå’Œpr~** ## 功能 diff --git a/package.json b/package.json index 6d06022f..9069d749 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "mockjs": "1.0.1-beta3", "normalize.css": "3.0.2", "nprogress": "0.2.0", - "showdown": "1.6.4", "simplemde": "1.11.2", "sortablejs": "1.5.1", "vue": "2.2.6", @@ -38,7 +37,6 @@ }, "devDependencies": { "autoprefixer": "6.7.2", - "axios-mock-adapter": "1.8.1", "babel-core": "6.22.1", "babel-eslint": "7.1.1", "babel-loader": "6.2.10", @@ -79,7 +77,7 @@ "vue-loader": "12.0.4", "vue-style-loader": "2.0.5", "vue-template-compiler": "2.2.6", - "webpack": "2.2.3", + "webpack": "2.5.1", "webpack-bundle-analyzer": "2.2.1", "webpack-dashboard": "0.2.1", "webpack-dev-middleware": "1.10.0", diff --git a/src/router/index.js b/src/router/index.js index 86caba70..76204649 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -64,11 +64,11 @@ const Permission = resolve => require(['../views/permission/index'], resolve); Vue.use(Router); /** - * icon :the icon show in the sidebar - * hidden: if hiddenLtrue will not show in the sidebar - * redirect :if redirect:noredirect will not redirct in the levelbar + * icon : the icon show in the sidebar + * hidden : if hidden:true will not show in the sidebar + * redirect : if redirect:noredirect will not redirct in the levelbar * noDropdown : if noDropdown:true will not has submenu - * meta: { role: ['admin'] } will control the page role + * meta : { role: ['admin'] } will control the page role */ export default new Router({ // mode: 'history', //åŽç«¯æ”¯æŒå¯å¼€ diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 12836172..869d0256 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -79,7 +79,7 @@ const user = { }, - // 获å–ç”¨æˆ·ä¿¡æ¯ + // 获å–ç”¨æˆ·ä¿¡æ¯ GetInfo({ commit, state }) { return new Promise((resolve, reject) => { getInfo(state.token).then(response => { @@ -125,7 +125,7 @@ const user = { }); }, - // å‰ç«¯ 登出 + // å‰ç«¯ 登出 FedLogOut({ commit }) { return new Promise(resolve => { commit('SET_TOKEN', ''); diff --git a/src/styles/mixin.scss b/src/styles/mixin.scss index 4368917e..822ab92a 100644 --- a/src/styles/mixin.scss +++ b/src/styles/mixin.scss @@ -37,19 +37,22 @@ $transparent-border-style: $width solid transparent; height: 0; width: 0; - @if $direction == up { + @if $direction==up { border-bottom: $color-border-style; border-left: $transparent-border-style; border-right: $transparent-border-style; - } @else if $direction == right { + } + @else if $direction==right { border-left: $color-border-style; border-top: $transparent-border-style; border-bottom: $transparent-border-style; - } @else if $direction == down { + } + @else if $direction==down { border-top: $color-border-style; border-left: $transparent-border-style; border-right: $transparent-border-style; - } @else if $direction == left { + } + @else if $direction==left { border-right: $color-border-style; border-top: $transparent-border-style; border-bottom: $transparent-border-style; diff --git a/src/utils/fetch.js b/src/utils/fetch.js index ab220140..8e589a8b 100644 --- a/src/utils/fetch.js +++ b/src/utils/fetch.js @@ -12,7 +12,6 @@ const service = axios.create({ // request拦截器 service.interceptors.request.use(config => { // Do something before request is sent - console.log(store.getters.token) if (store.getters.token) { config.headers['X-Token'] = store.getters.token; // 让æ¯ä¸ªè¯·æ±‚æºå¸¦token--['X-Token']为自定义key è¯·æ ¹æ®å®žé™…情况自行修改 } @@ -28,9 +27,8 @@ service.interceptors.response.use( response => response /** * 下é¢çš„注释为通过response自定义codeæ¥æ ‡ç¤ºè¯·æ±‚状æ€ï¼Œå½“code返回如下情况为æƒé™æœ‰é—®é¢˜ï¼Œç™»å‡ºå¹¶è¿”回到登录页 - * 如通过htmlrequest 状æ€ç æ ‡ç¤º 逻辑å¯å†™åœ¨ä¸‹é¢errorä¸ + * 如通过xmlhttprequest 状æ€ç æ ‡è¯† 逻辑å¯å†™åœ¨ä¸‹é¢errorä¸ */ - // const code = response.data.code; // // 50014:Token 过期了 50012:其他客户端登录了 50008:éžæ³•çš„token // if (code === 50008 || code === 50014 || code === 50012) { diff --git a/src/utils/index.js b/src/utils/index.js index 3f4c88bb..a011f17e 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,8 +1,6 @@ /** * Created by jiachenpan on 16/11/18. */ - import showdown from 'showdown' // markdown转化 - const converter = new showdown.Converter(); export function parseTime(time, cFormat) { if (arguments.length === 0) { @@ -214,6 +212,3 @@ } } - export function showdownMD(md) { - return converter.makeHtml(md) - } diff --git a/src/views/example/table.vue b/src/views/example/table.vue index 5d597e08..0664293e 100644 --- a/src/views/example/table.vue +++ b/src/views/example/table.vue @@ -321,8 +321,8 @@ }, handleFetchPv(pv) { fetchPv(pv).then(response => { - this.pvData = response.pvData - this.dialogPvVisible = true + this.pvData = response.data.pvData; + this.dialogPvVisible = true; }) }, handleDownload() { -- GitLab