Commit 35b43a11 authored by 张牧越's avatar 张牧越

路由结尾增加参数

parent 96736441
......@@ -16,6 +16,12 @@ export default {
},
methods: {
getXAccessToken() {
if (this.$route.query.premit_code) {
localStorage.setItem(
"PermitAuthorization",
this.$route.query.premit_code
);
}
if (this.$route.query.token_code != localStorage.getItem("token")) {
getXAccessToken(this.$route.query.token_code).then((res) => {
if (res.status == 200) {
......
This diff is collapsed.
......@@ -8,9 +8,13 @@ const noLoadingrequest = axios.create({
noLoadingrequest.interceptors.request.use(
config => {
const Authorization = localStorage.getItem('Authorization')
const PermitAuthorization = localStorage.getItem('PermitAuthorization')
if (Authorization) {
config.headers['Authorization'] = Authorization
}
if (PermitAuthorization) {
config.headers['Permit-Authorization'] = PermitAuthorization
}
return config
},
error => {
......
......@@ -41,9 +41,13 @@ const request = axios.create({
request.interceptors.request.use(
config => {
const Authorization = localStorage.getItem('Authorization')
const PermitAuthorization = localStorage.getItem('PermitAuthorization')
if (Authorization) {
config.headers['Authorization'] = Authorization
}
if (PermitAuthorization) {
config.headers['Permit-Authorization'] = PermitAuthorization
}
showLoading()
return config
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment