删除无用代码

Former-commit-id: df7ea6ac913379715f2f09d315ecaf2239f0fda8 [formerly df7ea6ac913379715f2f09d315ecaf2239f0fda8 [formerly df7ea6ac913379715f2f09d315ecaf2239f0fda8 [formerly df7ea6ac913379715f2f09d315ecaf2239f0fda8 [formerly 43e9755f8a40182dbaa6027312e2d9c0f1331751 [formerly 7d0dff3a621b3d47360c1c377358b1885760554d]]]]]
Former-commit-id: 727098e5f0103c313095ceb4ba4bda94ea0c6a7a
Former-commit-id: 98089e778a3662b230cd01cbb629b9563b88a9de
Former-commit-id: 089dc81d6836db8550e9c8f4130762735c5c368f [formerly ef6182ea0ad02d3c4281662bd4fd928cf1fea15e]
Former-commit-id: ea7551c3a2e625ebe701d32bba61810caa80bc2c
Former-commit-id: e6400de2d11fe05b10c71aa902d44e98c38fb540
Former-commit-id: d1317bace9081918e1cf1c6e64b3f71efef6c38b
Former-commit-id: 9baeb1b1fa6d4ab143b21e7d22c84ea3bfb69fa3
Former-commit-id: 5da47a5c01d745786f04aee341a62de577299028
This commit is contained in:
liyang
2018-07-17 16:38:59 +08:00
parent 74d1896955
commit 7fdc1327db
7 changed files with 37 additions and 29 deletions

View File

@@ -22,7 +22,6 @@ import '@/plugin/axios'
import '@/mock/register'
import pluginImport from '@/plugin/import'
import pluginExport from '@/plugin/export'
import pluginLog from '@/plugin/log'
import pluginOpen from '@/plugin/open'
import router from './router'
@@ -31,7 +30,6 @@ Vue.use(VCharts)
Vue.use(contentmenu)
Vue.use(pluginImport)
Vue.use(pluginExport)
Vue.use(pluginLog)
Vue.use(pluginOpen)
Vue.use(vueJsonTreeView)

View File

@@ -1,6 +1,18 @@
import Vue from 'vue'
import axios from 'axios'
// TODO: 做一些封装
axios.interceptors.response.use(res => {
if (res.data.code !== undefined) {
if (res.data.code !== 0) {
return Promise.reject(res.data.msg)
} else {
return res.data.data
}
} else {
return res.data
}
}, err => {
return Promise.reject(err)
})
Vue.prototype.$axios = axios

View File

@@ -1,18 +0,0 @@
export default {
install (Vue, options) {
// 打印log
// 如果只有一个参数 就只简单打印第一个参数
// 如果有大于一个参数 第一个参数会当做是分组的名称
Vue.prototype.$log = (arg1 = 'log', ...logs) => {
if (logs.length === 0) {
console.log(arg1)
} else {
console.group(arg1)
logs.forEach(e => {
console.log(e)
})
console.groupEnd()
}
}
}
}

View File

@@ -20,7 +20,8 @@ router.beforeEach((to, from, next) => {
if (to.matched.some(r => r.meta.requiresAuth)) {
// 这里暂时将cookie里是否存有token作为验证是否登陆的条件
// 请根据自身业务需要修改
if (Cookies.get('token')) {
const token = Cookies.get('token')
if (token && token !== 'undefined') {
next()
} else {
// 没有登陆的时候跳转到登陆界面

View File

@@ -4,7 +4,7 @@
<div class="layer flex-center">
<!-- logo部分 -->
<div class="logo-group">
<img src="@/assets/image/logo/w500.png" alt="logo">
<img src="./image/logo.png" alt="logo">
</div>
<!-- 表单部分 -->
<div class="form-group">
@@ -93,7 +93,9 @@ export default {
}
})
.then(res => {
this.$log('登结果', res)
console.group('登结果')
console.log('res: ', res)
console.groupEnd()
// cookie 一天的有效期
const setting = {
expires: 1
@@ -109,7 +111,9 @@ export default {
})
})
.catch(err => {
this.$log('错误信息', err)
console.group('登陆结果')
console.log('err: ', err)
console.groupEnd()
})
} else {
return false

View File

@@ -55,6 +55,17 @@ export default {
this.showInfo()
},
methods: {
log (arg1 = 'log', ...logs) {
if (logs.length === 0) {
console.log(arg1)
} else {
console.group(arg1)
logs.forEach(e => {
console.log(e)
})
console.groupEnd()
}
},
// 显示提示
showInfo () {
this.$notify({
@@ -71,16 +82,16 @@ export default {
console.groupEnd()
},
resizeHandler (i, newH, newW) {
this.$log('resizeHandler', `i: ${i}, newH: ${newH}, newW: ${newW}`)
this.log('resizeHandler', `i: ${i}, newH: ${newH}, newW: ${newW}`)
},
moveHandler (i, newX, newY) {
this.$log('moveHandler', `i: ${i}, newX: ${newX}, newY: ${newY}`)
this.log('moveHandler', `i: ${i}, newX: ${newX}, newY: ${newY}`)
},
resizedHandler (i, newH, newW, newHPx, newWPx) {
this.$log('resizedHandler', `i: ${i}, newH: ${newH}, newW: ${newW}, newHPx: ${newHPx}, newWPx: ${newWPx}`)
this.log('resizedHandler', `i: ${i}, newH: ${newH}, newW: ${newW}, newHPx: ${newHPx}, newWPx: ${newWPx}`)
},
movedHandler (i, newX, newY) {
this.$log('movedHandler', `i: ${i}, newX: ${newX}, newY: ${newY}`)
this.log('movedHandler', `i: ${i}, newX: ${newX}, newY: ${newY}`)
}
}
}