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

路由结尾增加参数

parent 96736441
...@@ -16,6 +16,12 @@ export default { ...@@ -16,6 +16,12 @@ export default {
}, },
methods: { methods: {
getXAccessToken() { getXAccessToken() {
if (this.$route.query.premit_code) {
localStorage.setItem(
"PermitAuthorization",
this.$route.query.premit_code
);
}
if (this.$route.query.token_code != localStorage.getItem("token")) { if (this.$route.query.token_code != localStorage.getItem("token")) {
getXAccessToken(this.$route.query.token_code).then((res) => { getXAccessToken(this.$route.query.token_code).then((res) => {
if (res.status == 200) { if (res.status == 200) {
......
This diff is collapsed.
...@@ -8,9 +8,13 @@ const noLoadingrequest = axios.create({ ...@@ -8,9 +8,13 @@ const noLoadingrequest = axios.create({
noLoadingrequest.interceptors.request.use( noLoadingrequest.interceptors.request.use(
config => { config => {
const Authorization = localStorage.getItem('Authorization') const Authorization = localStorage.getItem('Authorization')
const PermitAuthorization = localStorage.getItem('PermitAuthorization')
if (Authorization) { if (Authorization) {
config.headers['Authorization'] = Authorization config.headers['Authorization'] = Authorization
} }
if (PermitAuthorization) {
config.headers['Permit-Authorization'] = PermitAuthorization
}
return config return config
}, },
error => { error => {
......
...@@ -41,9 +41,13 @@ const request = axios.create({ ...@@ -41,9 +41,13 @@ const request = axios.create({
request.interceptors.request.use( request.interceptors.request.use(
config => { config => {
const Authorization = localStorage.getItem('Authorization') const Authorization = localStorage.getItem('Authorization')
const PermitAuthorization = localStorage.getItem('PermitAuthorization')
if (Authorization) { if (Authorization) {
config.headers['Authorization'] = Authorization config.headers['Authorization'] = Authorization
} }
if (PermitAuthorization) {
config.headers['Permit-Authorization'] = PermitAuthorization
}
showLoading() showLoading()
return config 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