diff --git a/src/components/Home.vue b/src/components/Home.vue index 38c5428..312805a 100644 --- a/src/components/Home.vue +++ b/src/components/Home.vue @@ -13,20 +13,20 @@ background-color="#313743" text-color="#fff" active-text-color="#ffd04b"> - + - + - 导航一 + {{subitem.authName}} @@ -40,11 +40,26 @@ diff --git a/src/main.js b/src/main.js index e404c3a..88e1d4e 100644 --- a/src/main.js +++ b/src/main.js @@ -8,6 +8,10 @@ import './assets/css/globel.css' import axios from 'axios' axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/' +axios.interceptors.request.use(config => { + config.headers.Authorization = sessionStorage.getItem('token') + return config +}) Vue.prototype.$http = axios Vue.use(ElementUI)