Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 02f1dc1d
authored
Apr 18, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit 修复
1 parent
2f3e02ef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
api/request/http.js
api/request/http.js
View file @
02f1dc1
...
...
@@ -14,13 +14,13 @@ const HOST = {
ip
:
'http://192.168.9.119:8292'
};
class
Request
{
get
(
params
,
returnAll
=
false
,
hostType
)
{
get
(
params
,
returnAll
=
false
,
hostType
)
{
return
this
.
request
(
"GET"
,
params
,
returnAll
,
hostType
);
}
post
(
params
,
returnAll
=
false
,
hostType
)
{
post
(
params
,
returnAll
=
false
,
hostType
)
{
return
this
.
request
(
"POST"
,
params
,
returnAll
,
hostType
);
}
fetch
(
method
,
data
,
returnAll
=
true
,
hostType
)
{
fetch
(
method
,
data
,
returnAll
=
true
,
hostType
)
{
return
this
.
post
(
{
method
,
...
...
@@ -30,7 +30,7 @@ class Request {
hostType
);
}
request
(
RequestMethods
,
params
,
returnAll
,
hostType
=
"dj"
)
{
request
(
RequestMethods
,
params
,
returnAll
,
hostType
=
"dj"
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
header
=
RequestMethods
===
"POST"
...
...
@@ -51,7 +51,7 @@ class Request {
header
,
dataType
:
"json"
,
responseType
:
"text"
,
success
(
response
)
{
success
(
response
)
{
/**业务代码 */
let
{
data
:
{
code
,
message
},
...
...
@@ -77,25 +77,25 @@ class Request {
}
}
},
fail
(
error
)
{
fail
(
error
)
{
uni
.
hideLoading
();
console
.
error
(
`
${
params
.
method
}
接口异常:`
,
error
);
uni
.
showToast
({
title
:
typeof
error
==
"string"
?
error
:
JSON
.
stringify
(
error
)
||
"系统异常"
,
:
error
.
errMsg
?
error
.
errMsg
:
JSON
.
stringify
(
error
)
||
"系统异常"
,
icon
:
"error"
,
});
reject
(
error
);
},
complete
()
{
complete
()
{
uni
.
stopPullDownRefresh
();
},
});
});
}
getData
(
params
,
hostType
=
"scrm"
)
{
getData
(
params
,
hostType
=
"scrm"
)
{
let
projectName
=
params
.
projectName
;
if
(
!
projectName
)
projectName
=
this
.
getRopProject
(
params
.
method
);
else
delete
params
.
projectName
;
...
...
@@ -127,11 +127,11 @@ class Request {
params
.
appKey
=
appKey
;
return
sign
(
params
,
secret
,
noSignAttr
);
}
getRopProject
(
method
)
{
getRopProject
(
method
)
{
const
projectName
=
method
.
split
(
"."
)[
2
];
return
projectName
;
}
uni_request
({
uni_request
({
url
,
method
=
"GET"
,
data
=
{},
...
...
@@ -147,7 +147,7 @@ class Request {
header
,
dataType
,
responseType
,
success
(
response
)
{
success
(
response
)
{
resolve
(
response
.
data
);
},
});
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment