Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
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
ReactWeb5
wisdom-components
Commits
69c19020
Commit
69c19020
authored
Jan 23, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 去除错误拦截
parent
17ef21f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
34 deletions
+34
-34
index.js
...ages/base-components/AlarmScrollAssembly/src/api/index.js
+17
-17
index.js
packages/base-components/BasicReport/src/api/index.js
+17
-17
No files found.
packages/base-components/AlarmScrollAssembly/src/api/index.js
View file @
69c19020
...
...
@@ -37,27 +37,27 @@ instanceRequest.setErrorHandler((error) => {
const
{
status
,
config
}
=
response
;
if
(
status
===
401
)
{
if
(
!
instance
)
{
instance
=
warning
({
title
:
'错误信息'
,
content
:
`
${
codeMessage
[
status
]}
`
,
centered
:
true
,
onOk
(
close
)
{
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
emit
(
'triggerLoginout'
);
close
();
},
});
//
instance = warning({
//
title: '错误信息',
//
content: `${codeMessage[status]}`,
//
centered: true,
//
onOk(close) {
//
window.share && window.share.event && window.share.event.emit('triggerLoginout');
//
close();
//
},
//
});
}
}
else
{
notification
.
error
({
message
:
`请求错误
${
status
}
:
${
config
.
url
}
`
,
description
:
errorText
,
});
//
notification.error({
//
message: `请求错误 ${status}: ${config.url}`,
//
description: errorText,
//
});
}
}
else
if
(
!
response
)
{
notification
.
error
({
description
:
'您的网络发生异常,无法连接服务器'
,
message
:
'网络异常'
,
});
//
notification.error({
//
description: '您的网络发生异常,无法连接服务器',
//
message: '网络异常',
//
});
}
return
response
;
});
...
...
packages/base-components/BasicReport/src/api/index.js
View file @
69c19020
...
...
@@ -34,27 +34,27 @@ instanceRequest.setErrorHandler((error) => {
const
{
status
,
config
}
=
response
;
if
(
status
===
401
)
{
if
(
!
instance
)
{
instance
=
warning
({
title
:
'错误信息'
,
content
:
`
${
codeMessage
[
status
]}
`
,
centered
:
true
,
onOk
(
close
)
{
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
emit
(
'triggerLoginout'
);
close
();
},
});
//
instance = warning({
//
title: '错误信息',
//
content: `${codeMessage[status]}`,
//
centered: true,
//
onOk(close) {
//
window.share && window.share.event && window.share.event.emit('triggerLoginout');
//
close();
//
},
//
});
}
}
else
{
notification
.
error
({
message
:
`请求错误
${
status
}
:
${
config
.
url
}
`
,
description
:
errorText
,
});
//
notification.error({
//
message: `请求错误 ${status}: ${config.url}`,
//
description: errorText,
//
});
}
}
else
if
(
!
response
)
{
notification
.
error
({
description
:
'您的网络发生异常,无法连接服务器'
,
message
:
'网络异常'
,
});
//
notification.error({
//
description: '您的网络发生异常,无法连接服务器',
//
message: '网络异常',
//
});
}
return
response
;
});
...
...
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