删除无用代码

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

@@ -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()
}
}
}
}