Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
national_museum_vod-H5
Project
Project
Details
Activity
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
fubaole
national_museum_vod-H5
Commits
94c22462
Commit
94c22462
authored
May 24, 2021
by
乐宝呗666
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改token过期的问题
parent
4e6f85c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
15273 deletions
+96
-15273
package-lock.json
package-lock.json
+91
-15268
request.js
src/config/request.js
+5
-5
No files found.
package-lock.json
View file @
94c22462
This diff is collapsed.
Click to expand it.
src/config/request.js
View file @
94c22462
...
@@ -99,9 +99,9 @@ const httpServer = (opts, data, file, timeout) => {
...
@@ -99,9 +99,9 @@ const httpServer = (opts, data, file, timeout) => {
let
authToken
=
""
;
let
authToken
=
""
;
if
(
opts
.
authType
&&
opts
.
authType
!=
""
)
{
if
(
opts
.
authType
&&
opts
.
authType
!=
""
)
{
if
(
opts
.
authType
===
"back"
)
{
if
(
opts
.
authType
===
"back"
)
{
authToken
=
sessionStorage
.
getItem
(
'
sT
oken'
)
||
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInVzZXJfaWQiOiIxIiwiaXNzIjoiSUFUQSIsImV4cCI6MTYxNjY2NTkzOCwiaWF0IjoxNjE2NjUxNTM4fQ._nqZq0LMwkurIBKJtfX-imXLCxQSNwJ-ueGZ8iwW-0oAW880gY7PjNEfroYYQZ91v0u5yQb73Alzvy6EIp6GGg"
authToken
=
sessionStorage
.
getItem
(
'
t
oken'
)
||
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInVzZXJfaWQiOiIxIiwiaXNzIjoiSUFUQSIsImV4cCI6MTYxNjY2NTkzOCwiaWF0IjoxNjE2NjUxNTM4fQ._nqZq0LMwkurIBKJtfX-imXLCxQSNwJ-ueGZ8iwW-0oAW880gY7PjNEfroYYQZ91v0u5yQb73Alzvy6EIp6GGg"
}
else
if
(
opts
.
authType
===
"front"
)
{
}
else
if
(
opts
.
authType
===
"front"
)
{
authToken
=
sessionStorage
.
getItem
(
"
sT
oken"
);
authToken
=
sessionStorage
.
getItem
(
"
t
oken"
);
}
}
httpDefaultOpts
.
headers
[
"Authorization"
]
=
authToken
httpDefaultOpts
.
headers
[
"Authorization"
]
=
authToken
}
}
...
@@ -109,7 +109,7 @@ const httpServer = (opts, data, file, timeout) => {
...
@@ -109,7 +109,7 @@ const httpServer = (opts, data, file, timeout) => {
delete
httpDefaultOpts
.
data
delete
httpDefaultOpts
.
data
httpDefaultOpts
.
params
.
timestamp_static
=
new
Date
().
getTime
();
httpDefaultOpts
.
params
.
timestamp_static
=
new
Date
().
getTime
();
}
else
{
}
else
{
//
delete httpDefaultOpts.params
delete
httpDefaultOpts
.
params
if
(
file
)
{
if
(
file
)
{
httpDefaultOpts
.
data
=
data
;
httpDefaultOpts
.
data
=
data
;
}
}
...
@@ -134,8 +134,8 @@ const httpServer = (opts, data, file, timeout) => {
...
@@ -134,8 +134,8 @@ const httpServer = (opts, data, file, timeout) => {
message
:
'您的登录过期,请重新登录!'
,
message
:
'您的登录过期,请重新登录!'
,
onClose
:
()
=>
{
onClose
:
()
=>
{
//这个时候点击确定后清除用户信息
//这个时候点击确定后清除用户信息
sessionStorage
.
removeItem
(
'
sT
oken'
)
sessionStorage
.
removeItem
(
'
t
oken'
)
sessionStorage
.
removeItem
(
'
sU
serInfo'
)
sessionStorage
.
removeItem
(
'
u
serInfo'
)
router
.
push
({
router
.
push
({
path
:
'/'
,
path
:
'/'
,
query
:
{
query
:
{
...
...
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