diff --git a/README.md b/README.md index d45c342e9e999c47f211912946258530aa4bed02..b0aa00eac785e8dbbf41332a3c926b95f7358a3a 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Understanding and learning this knowledge in advance will greatly help the use o - Error Log - Dashboard - Guide Page -- Echarts +- ECharts - Clipboard - Markdown to html ``` diff --git a/README.zh-CN.md b/README.zh-CN.md index bc114c3d1174ddee821d4c6512fd2bdc4dadcc2d..90438eeeeaf66b0a9fd614ee35021a4347448a3f 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -140,7 +140,7 @@ - 错误日志 - Dashboard - 引导页 -- Echarts 图表 +- ECharts 图表 - Clipboard(剪贴å¤åˆ¶) - Markdown2html ``` @@ -154,7 +154,7 @@ git clone https://github.com/PanJiaChen/vue-element-admin.git # 安装ä¾èµ– npm install -# 建议ä¸è¦ç”¨cnpm安装 会有å„ç§è¯¡å¼‚çš„bug å¯ä»¥é€šè¿‡å¦‚下æ“作解决 npm 下载速度慢的问题 +# 建议ä¸è¦ç”¨ cnpm 安装 会有å„ç§è¯¡å¼‚çš„bug å¯ä»¥é€šè¿‡å¦‚下æ“作解决 npm 下载速度慢的问题 npm install --registry=https://registry.npm.taobao.org # å¯åŠ¨æœåŠ¡ diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 6220cc6b781ac7d2b4f912a3908057646e313357..01f85732d364b5c6075a7408f5e95c3ff88c02d8 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -116,7 +116,7 @@ const webpackConfig = merge(baseWebpackConfig, { test: /[\\/]node_modules[\\/]element-ui[\\/]/ }, commons: { - name: 'chunk-comomns', + name: 'chunk-commons', test: resolve('src/components'), // å¯è‡ªå®šä¹‰æ‹“å±•ä½ çš„è§„åˆ™ minChunks: 3, // 最å°å…¬ç”¨æ¬¡æ•° priority: 5, diff --git a/src/components/Charts/mixins/resize.js b/src/components/Charts/mixins/resize.js index 254e905258a34f5d3c7e627555a166fc8b39c308..8497ebdc44703326ed971849faa031dd6bfdc383 100644 --- a/src/components/Charts/mixins/resize.js +++ b/src/components/Charts/mixins/resize.js @@ -2,14 +2,14 @@ import { debounce } from '@/utils' export default { mounted() { - this.__resizeHanlder = debounce(() => { + this.__resizeHandler = debounce(() => { if (this.chart) { this.chart.resize() } }, 100) - window.addEventListener('resize', this.__resizeHanlder) + window.addEventListener('resize', this.__resizeHandler) }, beforeDestroy() { - window.removeEventListener('resize', this.__resizeHanlder) + window.removeEventListener('resize', this.__resizeHandler) } } diff --git a/src/directive/clipboard/clipboard.js b/src/directive/clipboard/clipboard.js index 49c9b391a8fb777f6413234cc17de85699a4c91f..514aad20d408f0344ac77bbfcf8e2e56fc249476 100644 --- a/src/directive/clipboard/clipboard.js +++ b/src/directive/clipboard/clipboard.js @@ -1,7 +1,7 @@ // Inspired by https://github.com/Inndy/vue-clipboard2 const Clipboard = require('clipboard') if (!Clipboard) { - throw new Error('you shold npm install `clipboard` --save at first ') + throw new Error('you should npm install `clipboard` --save at first ') } export default { diff --git a/src/directive/el-dragDialog/drag.js b/src/directive/el-dragDialog/drag.js index 68e085232196eb807269cef62a2955776f4b440d..58e29110a0c04f92420c64174666e08d43925917 100644 --- a/src/directive/el-dragDialog/drag.js +++ b/src/directive/el-dragDialog/drag.js @@ -20,7 +20,7 @@ export default{ const disY = e.clientY - dialogHeaderEl.offsetTop const dragDomWidth = dragDom.offsetWidth - const dragDomheight = dragDom.offsetHeight + const dragDomHeight = dragDom.offsetHeight const screenWidth = document.body.clientWidth const screenHeight = document.body.clientHeight @@ -29,7 +29,7 @@ export default{ const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth const minDragDomTop = dragDom.offsetTop - const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight + const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight // 获å–到的值带px æ£åˆ™åŒ¹é…æ›¿æ¢ let styL = getStyle(dragDom, 'left') diff --git a/src/directive/waves/waves.js b/src/directive/waves/waves.js index 83070113d12ed498f770c57d61b295817ff6db36..a77f876e04f0eadf66cdd6a1bb4add915c57d367 100644 --- a/src/directive/waves/waves.js +++ b/src/directive/waves/waves.js @@ -6,7 +6,7 @@ export default{ const customOpts = Object.assign({}, binding.value) const opts = Object.assign({ ele: el, // æ³¢çº¹ä½œç”¨å…ƒç´ - type: 'hit', // hit点击ä½ç½®æ‰©æ•£centerä¸å¿ƒç‚¹æ‰©å±• + type: 'hit', // hit 点击ä½ç½®æ‰©æ•£ centerä¸å¿ƒç‚¹æ‰©å±• color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色 }, customOpts) const target = opts.ele diff --git a/src/filters/index.js b/src/filters/index.js index 47ef2aa22179d4242bba2c11b669361cc640174b..b164513a5b6c2f5f9fcd6fc72d8b01acc7d9361a 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -37,6 +37,6 @@ export function numberFormatter(num, digits) { return num.toString() } -export function toThousandslsFilter(num) { +export function toThousandFilter(num) { return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ',')) } diff --git a/src/permission.js b/src/permission.js index 22522832ac30ff61825bfe76ed1b0519823849a1..a20ceff6b10b06ed0b12aa0a96ebf4d660d8aa81 100644 --- a/src/permission.js +++ b/src/permission.js @@ -14,7 +14,7 @@ function hasPermission(roles, permissionRoles) { return roles.some(role => permissionRoles.indexOf(role) >= 0) } -const whiteList = ['/login', '/authredirect']// no redirect whitelist +const whiteList = ['/login', '/auth-redirect']// no redirect whitelist router.beforeEach((to, from, next) => { NProgress.start() // start progress bar diff --git a/src/router/index.js b/src/router/index.js index 5490185bdc5aa97f4584e80968b0fd3e0a9b6278..ab328c46ad29d336ecd354961950d9808563ea60 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -12,7 +12,7 @@ import chartsRouter from './modules/charts' import tableRouter from './modules/table' import nestedRouter from './modules/nested' -/** note: submenu only apppear when children.length>=1 +/** note: Submenu only appear when children.length>=1 * detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html **/ @@ -21,7 +21,7 @@ import nestedRouter from './modules/nested' * alwaysShow: true if set true, will always show the root menu, whatever its child routes length * if not set alwaysShow, only more than one route under the children * it will becomes nested mode, otherwise not show the root menu -* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb +* redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb * name:'router-name' the name is used by <keep-alive> (must set!!!) * meta : { roles: ['admin','editor'] will control the page roles (you can set multiple roles) @@ -48,7 +48,7 @@ export const constantRouterMap = [ hidden: true }, { - path: '/authredirect', + path: '/auth-redirect', component: () => import('@/views/login/authredirect'), hidden: true }, diff --git a/src/utils/request.js b/src/utils/request.js index 5ce539333150d2d4eebb1ad59e3990cf5d28a511..50f9ececb781229ae577a97c411a22b8bd06c9ee 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -5,7 +5,7 @@ import { getToken } from '@/utils/auth' // create an axios instance const service = axios.create({ - baseURL: process.env.BASE_API, // apiçš„base_url + baseURL: process.env.BASE_API, // api çš„ base_url timeout: 5000 // request timeout }) @@ -26,13 +26,13 @@ service.interceptors.request.use( } ) -// respone interceptor +// response interceptor service.interceptors.response.use( response => response, /** * 下é¢çš„注释为通过在response里,自定义codeæ¥æ ‡ç¤ºè¯·æ±‚çŠ¶æ€ * 当code返回如下情况则说明æƒé™æœ‰é—®é¢˜ï¼Œç™»å‡ºå¹¶è¿”回到登录页 - * 如想通过xmlhttprequestæ¥çŠ¶æ€ç æ ‡è¯† 逻辑å¯å†™åœ¨ä¸‹é¢errorä¸ + * 如想通过 xmlhttprequest æ¥çŠ¶æ€ç æ ‡è¯† 逻辑å¯å†™åœ¨ä¸‹é¢errorä¸ * 以下代ç å‡ä¸ºæ ·ä¾‹ï¼Œè¯·ç»“åˆè‡ªç”Ÿéœ€æ±‚åŠ ä»¥ä¿®æ”¹ï¼Œè‹¥ä¸éœ€è¦ï¼Œåˆ™å¯åˆ 除 */ // response => { diff --git a/src/views/dashboard/admin/components/BarChart.vue b/src/views/dashboard/admin/components/BarChart.vue index a694f2b93c3e6db60ee7cb1fdd73ea294ddd4c9e..28e0aef9f1d4b6e42158e4ca82d6ae82519a3646 100644 --- a/src/views/dashboard/admin/components/BarChart.vue +++ b/src/views/dashboard/admin/components/BarChart.vue @@ -31,18 +31,18 @@ export default { }, mounted() { this.initChart() - this.__resizeHanlder = debounce(() => { + this.__resizeHandler = debounce(() => { if (this.chart) { this.chart.resize() } }, 100) - window.addEventListener('resize', this.__resizeHanlder) + window.addEventListener('resize', this.__resizeHandler) }, beforeDestroy() { if (!this.chart) { return } - window.removeEventListener('resize', this.__resizeHanlder) + window.removeEventListener('resize', this.__resizeHandler) this.chart.dispose() this.chart = null }, diff --git a/src/views/dashboard/admin/components/LineChart.vue b/src/views/dashboard/admin/components/LineChart.vue index 6c6637a8864e19bb2e1a3e4fb0d5870532b3337b..390c25a4b51d7e1e8d9d132355f1b6ccc1b27c03 100644 --- a/src/views/dashboard/admin/components/LineChart.vue +++ b/src/views/dashboard/admin/components/LineChart.vue @@ -46,28 +46,28 @@ export default { mounted() { this.initChart() if (this.autoResize) { - this.__resizeHanlder = debounce(() => { + this.__resizeHandler = debounce(() => { if (this.chart) { this.chart.resize() } }, 100) - window.addEventListener('resize', this.__resizeHanlder) + window.addEventListener('resize', this.__resizeHandler) } // 监å¬ä¾§è¾¹æ çš„å˜åŒ– const sidebarElm = document.getElementsByClassName('sidebar-container')[0] - sidebarElm.addEventListener('transitionend', this.__resizeHanlder) + sidebarElm.addEventListener('transitionend', this.__resizeHandler) }, beforeDestroy() { if (!this.chart) { return } if (this.autoResize) { - window.removeEventListener('resize', this.__resizeHanlder) + window.removeEventListener('resize', this.__resizeHandler) } const sidebarElm = document.getElementsByClassName('sidebar-container')[0] - sidebarElm.removeEventListener('transitionend', this.__resizeHanlder) + sidebarElm.removeEventListener('transitionend', this.__resizeHandler) this.chart.dispose() this.chart = null diff --git a/src/views/dashboard/admin/components/PieChart.vue b/src/views/dashboard/admin/components/PieChart.vue index 02999cd3106a885d9f950b3c76d9ea5a98992176..edb17d54a3e201339595007f44f5e77996c340c0 100644 --- a/src/views/dashboard/admin/components/PieChart.vue +++ b/src/views/dashboard/admin/components/PieChart.vue @@ -29,18 +29,18 @@ export default { }, mounted() { this.initChart() - this.__resizeHanlder = debounce(() => { + this.__resizeHandler = debounce(() => { if (this.chart) { this.chart.resize() } }, 100) - window.addEventListener('resize', this.__resizeHanlder) + window.addEventListener('resize', this.__resizeHandler) }, beforeDestroy() { if (!this.chart) { return } - window.removeEventListener('resize', this.__resizeHanlder) + window.removeEventListener('resize', this.__resizeHandler) this.chart.dispose() this.chart = null }, diff --git a/src/views/dashboard/admin/components/RaddarChart.vue b/src/views/dashboard/admin/components/RaddarChart.vue index e30b9770ef2abdf138f8d422a1a98b7eccf43b94..11fde329d3a180ca035a9f09001096244ba11871 100644 --- a/src/views/dashboard/admin/components/RaddarChart.vue +++ b/src/views/dashboard/admin/components/RaddarChart.vue @@ -31,18 +31,18 @@ export default { }, mounted() { this.initChart() - this.__resizeHanlder = debounce(() => { + this.__resizeHandler = debounce(() => { if (this.chart) { this.chart.resize() } }, 100) - window.addEventListener('resize', this.__resizeHanlder) + window.addEventListener('resize', this.__resizeHandler) }, beforeDestroy() { if (!this.chart) { return } - window.removeEventListener('resize', this.__resizeHanlder) + window.removeEventListener('resize', this.__resizeHandler) this.chart.dispose() this.chart = null }, diff --git a/src/views/dashboard/admin/components/TransactionTable.vue b/src/views/dashboard/admin/components/TransactionTable.vue index bcbfbb43b8affba187e9a9fca89d0d305b7f8f2e..0741752387c4a1ec3954a3363996a10d34431dde 100644 --- a/src/views/dashboard/admin/components/TransactionTable.vue +++ b/src/views/dashboard/admin/components/TransactionTable.vue @@ -7,7 +7,7 @@ </el-table-column> <el-table-column label="Price" width="195" align="center"> <template slot-scope="scope"> - Â¥{{ scope.row.price | toThousandslsFilter }} + Â¥{{ scope.row.price | toThousandFilter }} </template> </el-table-column> <el-table-column label="Status" width="100" align="center"> diff --git a/src/views/documentation/index.vue b/src/views/documentation/index.vue index d40c2b678400767ebec7d7f674adbb757befee92..4c7afc9d4cced74478da80e04010b8b57736b923 100644 --- a/src/views/documentation/index.vue +++ b/src/views/documentation/index.vue @@ -35,7 +35,6 @@ export default { .document-btn { float: left; margin-left: 50px; - vertical-align: middle; display: block; cursor: pointer; background: black; diff --git a/src/views/login/authredirect.vue b/src/views/login/authredirect.vue index 52eb1aec9dcdb7ce687734501b1e85063454ec05..e749412b97de9ab706f6009de368fbafeceb4bb3 100644 --- a/src/views/login/authredirect.vue +++ b/src/views/login/authredirect.vue @@ -1,6 +1,6 @@ <script> export default { - name: 'Authredirect', + name: 'AuthRedirect', created() { const hash = window.location.search.slice(1) window.opener.location.href = window.location.origin + '/login#' + hash diff --git a/src/views/login/socialsignin.vue b/src/views/login/socialsignin.vue index b1d28a30022b84d3d94611ba90d47e149c9b7cfd..de5ac1d2f6122900997c3ce81b3a79d17eef90c2 100644 --- a/src/views/login/socialsignin.vue +++ b/src/views/login/socialsignin.vue @@ -18,14 +18,14 @@ export default { wechatHandleClick(thirdpart) { this.$store.commit('SET_AUTH_TYPE', thirdpart) const appid = 'xxxxx' - const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/authredirect') + const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect') const url = 'https://open.weixin.qq.com/connect/qrconnect?appid=' + appid + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_login#wechat_redirect' openWindow(url, thirdpart, 540, 540) }, tencentHandleClick(thirdpart) { this.$store.commit('SET_AUTH_TYPE', thirdpart) const client_id = 'xxxxx' - const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/authredirect') + const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect') const url = 'https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=' + client_id + '&redirect_uri=' + redirect_uri openWindow(url, thirdpart, 540, 540) }