Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hsWebHttpClient
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
何虹
hsWebHttpClient
Commits
018678a4
Commit
018678a4
authored
Feb 27, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isQueryMaster
parent
24e995f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
restful.js
src/packages/modules/restful.js
+23
-11
No files found.
src/packages/modules/restful.js
View file @
018678a4
...
...
@@ -13,15 +13,18 @@ class RestFul {
}
query
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
}
=
data
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
,
isQueryMaster
}
=
data
let
url
=
`
${
TOOL_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
const
header
=
{
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
return
this
.
requestClient
.
pu
st
(
url
,
bodyData
,
parms
)
return
this
.
requestClient
.
pu
t
(
url
,
bodyData
,
parms
,
header
)
}
else
{
return
this
.
requestClient
.
get
(
url
,
parms
)
return
this
.
requestClient
.
get
(
url
,
parms
,
header
)
}
}
save
(
data
)
{
...
...
@@ -35,38 +38,47 @@ class RestFul {
}
queryOne
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
}
=
data
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
TOOL_API
}${
appCode
}
/
${
tableName
}
/
${
id
}
/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
const
header
=
{
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
)
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
}
else
{
return
this
.
requestClient
.
get
(
url_
,
parms
)
return
this
.
requestClient
.
get
(
url_
,
parms
,
header
)
}
}
put
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
}
=
data
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
,
isQueryMaster
}
=
data
let
url
=
`
${
TOOL_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
)
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
{
isQueryMaster
:
isQueryMaster
?
1
:
0
})
}
queryList
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
parms
,
group
,
bodyData
}
=
data
const
{
tableName
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
TOOL_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
parms
.
fuzzy
=
1
const
header
=
{
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
)
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
}
else
{
return
this
.
requestClient
.
get
(
url_
,
parms
)
return
this
.
requestClient
.
get
(
url_
,
parms
,
header
)
}
}
deleteList
(
data
)
{
...
...
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