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
f57f7a87
Commit
f57f7a87
authored
Mar 12, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
读写分离加到头上
parent
3353ab96
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
28 deletions
+32
-28
hsWebHttpClient.js
dist/hsWebHttpClient.js
+17
-15
hsWebHttpClient.min.js
dist/hsWebHttpClient.min.js
+1
-1
restful.js
src/packages/modules/restful.js
+14
-12
No files found.
dist/hsWebHttpClient.js
View file @
f57f7a87
...
@@ -2003,8 +2003,8 @@ class Control {
...
@@ -2003,8 +2003,8 @@ class Control {
if
(
!
dbCode
)
{
if
(
!
dbCode
)
{
parms
.
dbCode
=
urlParam
.
dbCode
||
''
parms
.
dbCode
=
urlParam
.
dbCode
||
''
}
}
if
(
!
userId
&&
userId
!==
0
)
{
if
(
!
userId
)
{
parms
.
userId
=
-
2
parms
.
userId
=
-
1
}
}
if
(
!
configType
&&
configType
!==
0
)
{
if
(
!
configType
&&
configType
!==
0
)
{
parms
.
configType
=
-
2
parms
.
configType
=
-
2
...
@@ -2056,7 +2056,7 @@ class Control {
...
@@ -2056,7 +2056,7 @@ class Control {
*/
*/
webChartConfigQuery
(
data
)
{
webChartConfigQuery
(
data
)
{
this
.
packParamHandle
(
data
)
this
.
packParamHandle
(
data
)
const
{
appCode
,
pageName
,
controlName
,
userId
,
dbName
,
dbCode
,
configType
}
=
data
const
{
appCode
,
pageName
,
controlName
,
userId
,
dbName
,
dbCode
,
configType
}
=
data
const
postData
=
{
const
postData
=
{
exec_sql
:
`EXEC dbo.spappWebChartConfig_Query @sAppCode='
${
appCode
}
',@sPage='
${
pageName
}
',@sControl='
${
controlName
}
',@iUserId='
${
userId
}
',@iConfigType='
${
configType
}
'`
,
exec_sql
:
`EXEC dbo.spappWebChartConfig_Query @sAppCode='
${
appCode
}
',@sPage='
${
pageName
}
',@sControl='
${
controlName
}
',@iUserId='
${
userId
}
',@iConfigType='
${
configType
}
'`
,
db_name
:
dbName
,
db_name
:
dbName
,
...
@@ -22014,6 +22014,15 @@ class RestFul {
...
@@ -22014,6 +22014,15 @@ class RestFul {
parms
.
appCode
=
this
.
requestClient
.
appCode
//|| urlParam.appCode
parms
.
appCode
=
this
.
requestClient
.
appCode
//|| urlParam.appCode
}
}
}
}
mergeHeaderQueryMaster
(
isQueryMaster
)
{
if
(
isQueryMaster
)
{
return
{
'x-db_router_type'
:
'master'
}
}
else
{
return
{}
}
}
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
...
@@ -22021,9 +22030,7 @@ class RestFul {
...
@@ -22021,9 +22030,7 @@ class RestFul {
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
url
=
`
${
url
}${
group
}
/`
}
}
const
header
=
{
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
}
else
{
}
else
{
...
@@ -22046,9 +22053,7 @@ class RestFul {
...
@@ -22046,9 +22053,7 @@ class RestFul {
if
(
group
)
{
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
url_
=
`
${
url_
}${
group
}
/`
}
}
const
header
=
{
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
}
else
{
}
else
{
...
@@ -22062,9 +22067,8 @@ class RestFul {
...
@@ -22062,9 +22067,8 @@ class RestFul {
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
url
=
`
${
url
}${
group
}
/`
}
}
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
{
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
isQueryMaster
:
isQueryMaster
?
1
:
0
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
})
}
}
queryList
(
data
)
{
queryList
(
data
)
{
...
@@ -22075,9 +22079,7 @@ class RestFul {
...
@@ -22075,9 +22079,7 @@ class RestFul {
url_
=
`
${
url_
}${
group
}
/`
url_
=
`
${
url_
}${
group
}
/`
}
}
parms
.
fuzzy
=
1
parms
.
fuzzy
=
1
const
header
=
{
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
}
else
{
}
else
{
...
...
dist/hsWebHttpClient.min.js
View file @
f57f7a87
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 @
f57f7a87
...
@@ -11,6 +11,15 @@ class RestFul {
...
@@ -11,6 +11,15 @@ class RestFul {
parms
.
appCode
=
this
.
requestClient
.
appCode
//|| urlParam.appCode
parms
.
appCode
=
this
.
requestClient
.
appCode
//|| urlParam.appCode
}
}
}
}
mergeHeaderQueryMaster
(
isQueryMaster
)
{
if
(
isQueryMaster
)
{
return
{
'x-db_router_type'
:
'master'
}
}
else
{
return
{}
}
}
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
...
@@ -18,9 +27,7 @@ class RestFul {
...
@@ -18,9 +27,7 @@ class RestFul {
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
url
=
`
${
url
}${
group
}
/`
}
}
const
header
=
{
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
}
else
{
}
else
{
...
@@ -43,9 +50,7 @@ class RestFul {
...
@@ -43,9 +50,7 @@ class RestFul {
if
(
group
)
{
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
url_
=
`
${
url_
}${
group
}
/`
}
}
const
header
=
{
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
}
else
{
}
else
{
...
@@ -59,9 +64,8 @@ class RestFul {
...
@@ -59,9 +64,8 @@ class RestFul {
if
(
group
)
{
// 非标准保存
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
url
=
`
${
url
}${
group
}
/`
}
}
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
{
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
isQueryMaster
:
isQueryMaster
?
1
:
0
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
})
}
}
queryList
(
data
)
{
queryList
(
data
)
{
...
@@ -72,9 +76,7 @@ class RestFul {
...
@@ -72,9 +76,7 @@ class RestFul {
url_
=
`
${
url_
}${
group
}
/`
url_
=
`
${
url_
}${
group
}
/`
}
}
parms
.
fuzzy
=
1
parms
.
fuzzy
=
1
const
header
=
{
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
isQueryMaster
:
isQueryMaster
?
1
:
0
}
if
(
bodyData
)
{
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
}
else
{
}
else
{
...
...
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