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
0b1e6927
Commit
0b1e6927
authored
Oct 15, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
193ff14a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
18 deletions
+46
-18
hsWebHttpClient.js
dist/hsWebHttpClient.js
+23
-9
hsWebHttpClient.min.js
dist/hsWebHttpClient.min.js
+1
-1
restful.js
src/packages/modules/restful.js
+22
-8
No files found.
dist/hsWebHttpClient.js
View file @
0b1e6927
...
...
@@ -87,7 +87,7 @@ class Root {
return
hs_util_js__WEBPACK_IMPORTED_MODULE_1___default
().
SystemModule
.
parseGlobalParams
()
||
{}
}
getuUrlParam
()
{
hs_util_js__WEBPACK_IMPORTED_MODULE_1___default
().
SystemModule
.
getUrlParams
()
||
{}
return
hs_util_js__WEBPACK_IMPORTED_MODULE_1___default
().
SystemModule
.
getUrlParams
()
||
{}
}
filterEmptyValue
(
obj
)
{
if
(
!
obj
)
return
...
...
@@ -22035,7 +22035,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */
var
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
=
__webpack_require__
(
30
);
class
RestFul
{
constructor
(
requestClient
,
isService
)
{
constructor
(
requestClient
,
isService
)
{
this
.
requestClient
=
requestClient
this
.
moduleName
=
'RestFulModule'
// 如果isService 是字符串就直接试用这个字符串作为代理前缀,是不尔值:true就使用用默认的字符串:SERVICE_PROXY
...
...
@@ -22067,7 +22067,8 @@ class RestFul {
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
,
isQueryMaster
}
=
data
let
url
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
...
...
@@ -22081,15 +22082,24 @@ class RestFul {
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
}
=
data
let
url
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
return
this
.
requestClient
.
post
(
url
,
bodyData
,
parms
)
}
queryOne
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
//${id}/`
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
//${id}/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
...
...
@@ -22105,7 +22115,8 @@ class RestFul {
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
,
isQueryMaster
}
=
data
let
url
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
...
...
@@ -22128,8 +22139,11 @@ class RestFul {
}
deleteList
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
parms
}
=
data
const
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
const
{
tableName
,
appCode
,
bodyData
,
parms
,
ids
}
=
data
let
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
ids
)
{
url_
+
ids
+
'/'
}
return
this
.
requestClient
.
delete
(
url_
,
bodyData
,
parms
)
}
}
...
...
dist/hsWebHttpClient.min.js
View file @
0b1e6927
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/packages/modules/restful.js
View file @
0b1e6927
import
{
TOOL_API
,
SERVICE_API
}
from
'../common/commonModule'
class
RestFul
{
constructor
(
requestClient
,
isService
)
{
constructor
(
requestClient
,
isService
)
{
this
.
requestClient
=
requestClient
this
.
moduleName
=
'RestFulModule'
// 如果isService 是字符串就直接试用这个字符串作为代理前缀,是不尔值:true就使用用默认的字符串:SERVICE_PROXY
...
...
@@ -32,7 +32,8 @@ class RestFul {
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
,
isQueryMaster
}
=
data
let
url
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
...
...
@@ -46,15 +47,24 @@ class RestFul {
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
}
=
data
let
url
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
return
this
.
requestClient
.
post
(
url
,
bodyData
,
parms
)
}
queryOne
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
//${id}/`
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
//${id}/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
...
...
@@ -70,7 +80,8 @@ class RestFul {
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
,
isQueryMaster
}
=
data
let
url
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
...
...
@@ -93,8 +104,11 @@ class RestFul {
}
deleteList
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
parms
}
=
data
const
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
const
{
tableName
,
appCode
,
bodyData
,
parms
,
ids
}
=
data
let
url_
=
`
${
this
.
MODULE_API
}${
appCode
}
/
${
tableName
}
/`
if
(
ids
)
{
url_
+
ids
+
'/'
}
return
this
.
requestClient
.
delete
(
url_
,
bodyData
,
parms
)
}
}
...
...
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