Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
XieZhiXiong
jinfa-platform
Commits
714ab977
Commit
714ab977
authored
Feb 16, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复切换了语言,但是请求错误还是中文的问题
parent
7c2c0351
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
request.ts
src/utils/request.ts
+2
-1
No files found.
src/utils/request.ts
View file @
714ab977
...
@@ -27,7 +27,6 @@ type httpStatus = {
...
@@ -27,7 +27,6 @@ type httpStatus = {
[
key
:
number
]:
string
[
key
:
number
]:
string
}
}
const
intl
=
getIntl
()
const
errorMessage
:
httpStatus
=
{
const
errorMessage
:
httpStatus
=
{
400
:
"发出的请求有错误,服务器没有进行新建或修改数据的操作。"
,
400
:
"发出的请求有错误,服务器没有进行新建或修改数据的操作。"
,
401
:
"用户没有权限(令牌、用户名、密码错误)。"
,
401
:
"用户没有权限(令牌、用户名、密码错误)。"
,
...
@@ -129,6 +128,8 @@ class ApiRequest {
...
@@ -129,6 +128,8 @@ class ApiRequest {
createRequest
<
T
>
(
url
:
string
,
options
:
IApiRequest
=
{
ctlType
:
'none'
}):
Promise
<
IRequestSuccess
<
T
>>
{
createRequest
<
T
>
(
url
:
string
,
options
:
IApiRequest
=
{
ctlType
:
'none'
}):
Promise
<
IRequestSuccess
<
T
>>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
intl
=
getIntl
()
baseRequest
<
IRequestSuccess
<
T
>>
(
url
,
options
).
then
(
res
=>
{
baseRequest
<
IRequestSuccess
<
T
>>
(
url
,
options
).
then
(
res
=>
{
// 登录验证
// 登录验证
if
(
res
.
code
===
1101
)
{
if
(
res
.
code
===
1101
)
{
...
...
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