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
Show 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 {
if (!dbCode) {
parms.dbCode = urlParam.dbCode || ''
}
if (!userId
&& userId !== 0
) {
parms.userId = -
2
if (!userId) {
parms.userId = -
1
}
if (!configType && configType !== 0) {
parms.configType = -2
...
...
@@ -2056,7 +2056,7 @@ class Control {
*/
webChartConfigQuery (data) {
this.packParamHandle(data)
const { appCode, pageName, controlName, userId, dbName, dbCode,configType } = data
const { appCode, pageName, controlName, userId, dbName, dbCode,
configType } = data
const postData = {
exec_sql: `EXEC dbo.spappWebChartConfig_Query @sAppCode='${appCode}',@sPage='${pageName}',@sControl='${controlName}',@iUserId='${userId}',@iConfigType='${configType}'`,
db_name: dbName,
...
...
@@ -22014,6 +22014,15 @@ class RestFul {
parms.appCode = this.requestClient.appCode //|| urlParam.appCode
}
}
mergeHeaderQueryMaster (isQueryMaster) {
if (isQueryMaster) {
return {
'x-db_router_type': 'master'
}
} else {
return {}
}
}
query (data) {
this.packParamHandle(data)
const { tableName, appCode, group, parms, bodyData, isQueryMaster } = data
...
...
@@ -22021,9 +22030,7 @@ class RestFul {
if (group) { // 非标准保存
url = `${url}${group}/`
}
const header = {
isQueryMaster: isQueryMaster ? 1 : 0
}
const header = this.mergeHeaderQueryMaster(isQueryMaster)
if (bodyData) {
return this.requestClient.put(url, bodyData, parms, header)
} else {
...
...
@@ -22046,9 +22053,7 @@ class RestFul {
if (group) {
url_ = `${url_}${group}/`
}
const header = {
isQueryMaster: isQueryMaster ? 1 : 0
}
const header = this.mergeHeaderQueryMaster(isQueryMaster)
if (bodyData) {
return this.requestClient.put(url_, bodyData, parms, header)
} else {
...
...
@@ -22062,9 +22067,8 @@ class RestFul {
if (group) { // 非标准保存
url = `${url}${group}/`
}
return this.requestClient.put(url, bodyData, parms, {
isQueryMaster: isQueryMaster ? 1 : 0
})
const header = this.mergeHeaderQueryMaster(isQueryMaster)
return this.requestClient.put(url, bodyData, parms, header)
}
queryList (data) {
...
...
@@ -22075,9 +22079,7 @@ class RestFul {
url_ = `${url_}${group}/`
}
parms.fuzzy = 1
const header = {
isQueryMaster: isQueryMaster ? 1 : 0
}
const header = this.mergeHeaderQueryMaster(isQueryMaster)
if (bodyData) {
return this.requestClient.put(url_, bodyData, parms, header)
} 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 {
parms
.
appCode
=
this
.
requestClient
.
appCode
//|| urlParam.appCode
}
}
mergeHeaderQueryMaster
(
isQueryMaster
)
{
if
(
isQueryMaster
)
{
return
{
'x-db_router_type'
:
'master'
}
}
else
{
return
{}
}
}
query
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
,
isQueryMaster
}
=
data
...
...
@@ -18,9 +27,7 @@ class RestFul {
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
const
header
=
{
isQueryMaster
:
isQueryMaster
?
1
:
0
}
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
}
else
{
...
...
@@ -43,9 +50,7 @@ class RestFul {
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
const
header
=
{
isQueryMaster
:
isQueryMaster
?
1
:
0
}
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
}
else
{
...
...
@@ -59,9 +64,8 @@ class RestFul {
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
{
isQueryMaster
:
isQueryMaster
?
1
:
0
})
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
}
queryList
(
data
)
{
...
...
@@ -72,9 +76,7 @@ class RestFul {
url_
=
`
${
url_
}${
group
}
/`
}
parms
.
fuzzy
=
1
const
header
=
{
isQueryMaster
:
isQueryMaster
?
1
:
0
}
const
header
=
this
.
mergeHeaderQueryMaster
(
isQueryMaster
)
if
(
bodyData
)
{
return
this
.
requestClient
.
put
(
url_
,
bodyData
,
parms
,
header
)
}
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