自定义路由

This commit is contained in:
tanghc
2019-06-14 17:28:18 +08:00
parent 3ee105a092
commit b21a02c4a5
36 changed files with 803 additions and 197 deletions

View File

@@ -8,7 +8,7 @@ import { getToken, removeToken } from './auth'
// 创建axios实例
const client = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // api 的 base_url
timeout: 5000 // 请求超时时间
timeout: 10000 // 请求超时时间
})
Object.assign(Vue.prototype, {
@@ -94,6 +94,14 @@ Object.assign(Vue.prototype, {
}
}).catch(function() {})
},
/**
* 重置表单
* @param formName 表单元素的ref
*/
resetForm(formName) {
const frm = this.$refs[formName]
frm && frm.resetFields()
},
logout: function() {
removeToken()
const fullPath = this.$route.fullPath