From 47a1bce8f9a8f53ca13338976987e62bbfd77d3e Mon Sep 17 00:00:00 2001 From: xing Date: Wed, 17 Jun 2020 10:28:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Home.vue | 23 +++++++++++++++++++---- src/main.js | 4 ++++ 2 files changed, 23 insertions(+), 4 deletions(-) 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)