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
545e13c4
Commit
545e13c4
authored
May 28, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化bug
parent
00f788a9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
restful.js
src/packages/modules/restful.js
+9
-8
No files found.
src/packages/modules/restful.js
View file @
545e13c4
...
@@ -5,10 +5,11 @@ class RestFul {
...
@@ -5,10 +5,11 @@ class RestFul {
this
.
moduleName
=
'RestFulModule'
this
.
moduleName
=
'RestFulModule'
// 如果isService 是字符串就直接试用这个字符串作为代理前缀,是不尔值:true就使用用默认的字符串:SERVICE_PROXY
// 如果isService 是字符串就直接试用这个字符串作为代理前缀,是不尔值:true就使用用默认的字符串:SERVICE_PROXY
const
typeof_isService
=
typeof
isService
const
typeof_isService
=
typeof
isService
this
.
MODULE_API
=
TOOL_API
if
(
typeof_isService
===
'boolean'
)
{
if
(
typeof_isService
===
'boolean'
)
{
this
.
MODULEAPI
=
isService
?
SERVICE_API
:
TOOL_API
this
.
MODULE
_
API
=
isService
?
SERVICE_API
:
TOOL_API
}
else
if
(
typeof_isService
===
'string'
&&
isService
)
{
}
else
if
(
typeof_isService
===
'string'
&&
isService
)
{
this
.
MODULEAPI
=
isService
this
.
MODULE
_
API
=
isService
}
}
}
}
// 处理传入的data 如果有appCode dbName
// 处理传入的data 如果有appCode dbName
...
@@ -30,7 +31,7 @@ class RestFul {
...
@@ -30,7 +31,7 @@ class RestFul {
query
(
data
)
{
query
(
data
)
{
this
.
packParamHandle
(
data
)
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
,
isQueryMaster
}
=
data
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
,
isQueryMaster
}
=
data
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
this
.
MODULE_
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
url
=
`
${
url
}${
group
}
/`
}
}
...
@@ -44,7 +45,7 @@ class RestFul {
...
@@ -44,7 +45,7 @@ class RestFul {
save
(
data
)
{
save
(
data
)
{
this
.
packParamHandle
(
data
)
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
}
=
data
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
}
=
data
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
this
.
MODULE_
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
url
=
`
${
url
}${
group
}
/`
}
}
...
@@ -53,7 +54,7 @@ class RestFul {
...
@@ -53,7 +54,7 @@ class RestFul {
queryOne
(
data
)
{
queryOne
(
data
)
{
this
.
packParamHandle
(
data
)
this
.
packParamHandle
(
data
)
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/
${
id
}
/`
let
url_
=
`
${
this
.
MODULE_
API
}${
appCode
}
/
${
tableName
}
/
${
id
}
/`
if
(
group
)
{
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
url_
=
`
${
url_
}${
group
}
/`
}
}
...
@@ -67,7 +68,7 @@ class RestFul {
...
@@ -67,7 +68,7 @@ class RestFul {
put
(
data
)
{
put
(
data
)
{
this
.
packParamHandle
(
data
)
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
,
isQueryMaster
}
=
data
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
,
isQueryMaster
}
=
data
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
this
.
MODULE_
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
url
=
`
${
url
}${
group
}
/`
}
}
...
@@ -77,7 +78,7 @@ class RestFul {
...
@@ -77,7 +78,7 @@ class RestFul {
queryList
(
data
)
{
queryList
(
data
)
{
this
.
packParamHandle
(
data
)
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
const
{
tableName
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
let
url_
=
`
${
this
.
MODULE_
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
url_
=
`
${
url_
}${
group
}
/`
}
}
...
@@ -92,7 +93,7 @@ class RestFul {
...
@@ -92,7 +93,7 @@ class RestFul {
deleteList
(
data
)
{
deleteList
(
data
)
{
this
.
packParamHandle
(
data
)
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
parms
}
=
data
const
{
tableName
,
appCode
,
bodyData
,
parms
}
=
data
const
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
const
url_
=
`
${
this
.
MODULE_
API
}${
appCode
}
/
${
tableName
}
/`
return
this
.
requestClient
.
delete
(
url_
,
bodyData
,
parms
)
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