Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
digital-construction
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张牧越
digital-construction
Commits
35b43a11
Commit
35b43a11
authored
Jul 25, 2023
by
张牧越
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
路由结尾增加参数
parent
96736441
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
178 additions
and
141 deletions
+178
-141
App.vue
src/App.vue
+6
-0
index.js
src/api/index.js
+164
-141
noloadingRequest.js
src/utils/noloadingRequest.js
+4
-0
request.js
src/utils/request.js
+4
-0
No files found.
src/App.vue
View file @
35b43a11
...
@@ -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
)
{
...
...
src/api/index.js
View file @
35b43a11
This diff is collapsed.
Click to expand it.
src/utils/noloadingRequest.js
View file @
35b43a11
...
@@ -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
=>
{
...
...
src/utils/request.js
View file @
35b43a11
...
@@ -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
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment