Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
broadcast_cloud
/
web-live
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
2
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fd28472d
authored
Apr 14, 2021
by
MichaelJier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
5817c8bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
plugins/API/request.js
+2
-0
No files found.
plugins/API/request.js
View file @
fd28472d
...
@@ -46,6 +46,7 @@ service.interceptors.request.use(
...
@@ -46,6 +46,7 @@ service.interceptors.request.use(
const
key
=
md5
(
config
.
url
+
JSON
.
stringify
(
params
)
+
JSON
.
stringify
(
headers
))
const
key
=
md5
(
config
.
url
+
JSON
.
stringify
(
params
)
+
JSON
.
stringify
(
headers
))
// 缓存命中
// 缓存命中
if
(
CACHED
.
has
(
key
))
{
if
(
CACHED
.
has
(
key
))
{
console
.
log
(
'CACHED'
,
CACHED
.
get
(
key
))
return
Promise
.
resolve
(
CACHED
.
get
(
key
))
return
Promise
.
resolve
(
CACHED
.
get
(
key
))
}
}
}
}
...
@@ -68,6 +69,7 @@ service.interceptors.response.use(
...
@@ -68,6 +69,7 @@ service.interceptors.response.use(
const
{
code
,
errorCode
,
errorMessage
}
=
data
;
const
{
code
,
errorCode
,
errorMessage
}
=
data
;
if
(
!
process
.
client
)
{
if
(
!
process
.
client
)
{
const
{
params
=
{},
headers
=
{}
}
=
config
const
{
params
=
{},
headers
=
{}
}
=
config
console
.
log
(
data
)
const
key
=
md5
(
config
.
url
+
JSON
.
stringify
(
params
)
+
JSON
.
stringify
(
headers
))
const
key
=
md5
(
config
.
url
+
JSON
.
stringify
(
params
)
+
JSON
.
stringify
(
headers
))
CACHED
.
set
(
key
,
data
)
CACHED
.
set
(
key
,
data
)
}
}
...
...
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