Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shld-databoard-ui
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
潘自豪 Rambo Pan
shld-databoard-ui
Commits
aafa21a7
Commit
aafa21a7
authored
Sep 26, 2023
by
潘自豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除硬编码
parent
772a5894
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
fetch.js
src/module/api/fetch.js
+3
-0
No files found.
src/module/api/fetch.js
View file @
aafa21a7
...
@@ -44,6 +44,9 @@ export default async (url = '', data = {}, type = 'GET', method = 'fetch') => {
...
@@ -44,6 +44,9 @@ export default async (url = '', data = {}, type = 'GET', method = 'fetch') => {
try
{
try
{
const
response
=
await
fetch
(
url
,
requestConfig
);
const
response
=
await
fetch
(
url
,
requestConfig
);
const
responseJson
=
await
response
.
json
();
const
responseJson
=
await
response
.
json
();
if
(
response
.
status
===
403
){
parent
.
window
.
location
=
"/"
;
}
return
responseJson
return
responseJson
}
catch
(
error
)
{
}
catch
(
error
)
{
throw
new
Error
(
error
)
throw
new
Error
(
error
)
...
...
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