Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RB-studyChina-20250617
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
RB-studyChina-20250617
Commits
39d3e614
Commit
39d3e614
authored
Jun 04, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
173f9173
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
errorHandler.ts
src/utils/errorHandler.ts
+9
-8
No files found.
src/utils/errorHandler.ts
View file @
39d3e614
...
...
@@ -13,7 +13,8 @@ export const errMessageMap = {
200303
:
'助力机会已用完,一起来参与活动吧~'
,
200304
:
"好友今日助力次数已达上限~"
,
200305
:
"已为好友助力哦~"
,
20002
:
"活动已结束"
20002
:
"活动已结束"
,
500044
:
null
,
};
/**
...
...
@@ -22,11 +23,11 @@ export const errMessageMap = {
*/
export
function
errorHandler
(
error
)
{
if
((
error
.
code
==
0
&&
error
.
message
==
"请稍后再试"
)
||
filterCode
.
indexOf
(
`
${
error
.
code
}
`
)
>=
0
)
return
;
switch
(
error
.
code
)
{
default
:
{
const
msg
=
errMessageMap
[
error
.
code
]
||
error
.
message
||
'网络异常,请稍后再试'
;
Toast
.
show
(
msg
);
break
;
}
}
const
cfgMsg
=
errMessageMap
[
error
.
code
];
if
(
cfgMsg
===
null
)
return
;
// 不提示的错误码
const
msg
=
cfgMsg
||
error
.
message
||
'网络异常,请稍后再试'
;
Toast
.
show
(
msg
);
}
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