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
66d3cc72
Commit
66d3cc72
authored
May 28, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容serviceAPI
parent
c2df90d7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
24 deletions
+42
-24
hsWebHttpClient.js
dist/hsWebHttpClient.js
+21
-11
hsWebHttpClient.min.js
dist/hsWebHttpClient.min.js
+1
-1
index.js
src/index.js
+2
-2
commonModule.js
src/packages/common/commonModule.js
+2
-1
commonProxy.js
src/packages/common/commonProxy.js
+1
-0
restful.js
src/packages/modules/restful.js
+15
-9
No files found.
dist/hsWebHttpClient.js
View file @
66d3cc72
...
...
@@ -31,13 +31,13 @@ __webpack_require__.r(__webpack_exports__);
class
HttpClient
{
constructor
(
axios
,
appCode
,
pageName
)
{
constructor
(
axios
,
appCode
,
pageName
,
isService
)
{
this
.
axios
=
axios
const
root
=
new
_root__WEBPACK_IMPORTED_MODULE_0__
.
default
(
axios
)
appCode
&&
(
root
.
appCode
=
appCode
)
pageName
&&
(
root
.
pageName
=
pageName
)
this
.
root
=
root
const
restful
=
new
_packages_modules_restful__WEBPACK_IMPORTED_MODULE_3__
.
default
(
root
)
const
restful
=
new
_packages_modules_restful__WEBPACK_IMPORTED_MODULE_3__
.
default
(
root
,
isService
)
const
webQueryClient
=
new
_packages_modules_webQueryClient__WEBPACK_IMPORTED_MODULE_5__
.
default
(
root
)
const
billflow
=
new
_packages_modules_billflow__WEBPACK_IMPORTED_MODULE_1__
.
default
(
root
)
const
system
=
new
_packages_modules_system__WEBPACK_IMPORTED_MODULE_4__
.
default
(
root
,
restful
)
...
...
@@ -21783,6 +21783,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */
"SQL_GQL"
:
function
()
{
return
/* binding */
SQL_GQL
;
},
/* harmony export */
"SQL_GQL_SAVE"
:
function
()
{
return
/* binding */
SQL_GQL_SAVE
;
},
/* harmony export */
"TOOL_API"
:
function
()
{
return
/* binding */
TOOL_API
;
},
/* harmony export */
"SERVICE_API"
:
function
()
{
return
/* binding */
SERVICE_API
;
},
/* harmony export */
"AUDIT_BILLS"
:
function
()
{
return
/* binding */
AUDIT_BILLS
;
},
/* harmony export */
"UN_AUDIT_BILLS"
:
function
()
{
return
/* binding */
UN_AUDIT_BILLS
;
},
/* harmony export */
"CLOSE_BILLS"
:
function
()
{
return
/* binding */
CLOSE_BILLS
;
},
...
...
@@ -21800,6 +21801,7 @@ const WEB_QUERY_PAGE = `${_commonProxy__WEBPACK_IMPORTED_MODULE_0__.TOOL_PROXY}/
const
SQL_GQL
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
GQL_PROXY
}
/sql_gql/`
const
SQL_GQL_SAVE
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
GQL_PROXY
}
/sql_gql/save/`
const
TOOL_API
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
TOOL_PROXY
}
/api/`
const
SERVICE_API
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
SERVICE_PROXY
}
/`
// 单据流
const
AUDIT_BILLS
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
COMMON_UTIL_PROXY
}
/audit_bills/`
const
UN_AUDIT_BILLS
=
`
${
_commonProxy__WEBPACK_IMPORTED_MODULE_0__
.
COMMON_UTIL_PROXY
}
/un_audit_bills/`
...
...
@@ -21823,7 +21825,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */
"COMMON_UTIL_PROXY"
:
function
()
{
return
/* binding */
COMMON_UTIL_PROXY
;
},
/* harmony export */
"COMMON_PROXY"
:
function
()
{
return
/* binding */
COMMON_PROXY
;
},
/* harmony export */
"GQL_PROXY"
:
function
()
{
return
/* binding */
GQL_PROXY
;
},
/* harmony export */
"FILE_RESOURCE_PROXY"
:
function
()
{
return
/* binding */
FILE_RESOURCE_PROXY
;
}
/* harmony export */
"FILE_RESOURCE_PROXY"
:
function
()
{
return
/* binding */
FILE_RESOURCE_PROXY
;
},
/* harmony export */
"SERVICE_PROXY"
:
function
()
{
return
/* binding */
SERVICE_PROXY
;
}
/* harmony export */
});
const
OAUTH_PROXY
=
'OAUTH_PROXY'
// `http://${api}/HSRight/api/`
const
TOOL_PROXY
=
'TOOL_PROXY'
// `http://${api}/Tool/api/`
...
...
@@ -21832,6 +21835,7 @@ const COMMON_UTIL_PROXY = 'COMMON_UTIL_PROXY' // `http://${api}/CommonUtil/api/`
const
COMMON_PROXY
=
'COMMON_PROXY'
// `http://${api}/`
const
GQL_PROXY
=
'GQL_PROXY'
// `http://${api}/GQL/api/`
const
FILE_RESOURCE_PROXY
=
'FILE_RESOURCE_PROXY'
// `http://${api}/fileresource/api/`
const
SERVICE_PROXY
=
'SERVICE_PROXY'
// `SERVICE_PROXY`
/***/
}),
...
...
@@ -22024,9 +22028,16 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */
var
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
=
__webpack_require__
(
30
);
class
RestFul
{
constructor
(
requestClient
)
{
constructor
(
requestClient
,
isService
)
{
this
.
requestClient
=
requestClient
this
.
moduleName
=
'RestFulModule'
// 如果isService 是字符串就直接试用这个字符串作为代理前缀,是不尔值:true就使用用默认的字符串:SERVICE_PROXY
const
typeof_isService
=
typeof
isService
if
(
typeof_isService
===
'boolean'
)
{
this
.
MODULEAPI
=
isService
?
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
SERVICE_API
:
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
TOOL_API
}
else
if
(
typeof_isService
===
'string'
&&
isService
)
{
this
.
MODULEAPI
=
isService
}
}
// 处理传入的data 如果有appCode dbName
packParamHandle
(
parms
)
{
...
...
@@ -22047,7 +22058,7 @@ class RestFul {
query
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
,
isQueryMaster
}
=
data
let
url
=
`
${
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
...
...
@@ -22061,7 +22072,7 @@ class RestFul {
save
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
}
=
data
let
url
=
`
${
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
...
...
@@ -22070,7 +22081,7 @@ class RestFul {
queryOne
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
TOOL_
API
}${
appCode
}
/
${
tableName
}
/
${
id
}
/`
let
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/
${
id
}
/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
...
...
@@ -22084,7 +22095,7 @@ class RestFul {
put
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
,
isQueryMaster
}
=
data
let
url
=
`
${
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
...
...
@@ -22092,10 +22103,9 @@ class RestFul {
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
}
queryList
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
let
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
...
...
@@ -22110,7 +22120,7 @@ class RestFul {
deleteList
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
parms
}
=
data
const
url_
=
`
${
_common_commonModule__WEBPACK_IMPORTED_MODULE_0__
.
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
const
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
return
this
.
requestClient
.
delete
(
url_
,
bodyData
,
parms
)
}
}
...
...
dist/hsWebHttpClient.min.js
View file @
66d3cc72
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/index.js
View file @
66d3cc72
...
...
@@ -7,13 +7,13 @@ import System from './packages/modules/system'
import
WebQueryClient
from
'./packages/modules/webQueryClient'
import
Ref
from
'./packages/modules/ref'
class
HttpClient
{
constructor
(
axios
,
appCode
,
pageName
)
{
constructor
(
axios
,
appCode
,
pageName
,
isService
)
{
this
.
axios
=
axios
const
root
=
new
Root
(
axios
)
appCode
&&
(
root
.
appCode
=
appCode
)
pageName
&&
(
root
.
pageName
=
pageName
)
this
.
root
=
root
const
restful
=
new
Restful
(
root
)
const
restful
=
new
Restful
(
root
,
isService
)
const
webQueryClient
=
new
WebQueryClient
(
root
)
const
billflow
=
new
Billflow
(
root
)
const
system
=
new
System
(
root
,
restful
)
...
...
src/packages/common/commonModule.js
View file @
66d3cc72
import
{
TOOL_PROXY
,
GQL_PROXY
,
COMMON_UTIL_PROXY
}
from
'./commonProxy'
import
{
TOOL_PROXY
,
GQL_PROXY
,
COMMON_UTIL_PROXY
,
SERVICE_PROXY
}
from
'./commonProxy'
export
const
WEB_QUERY
=
`
${
TOOL_PROXY
}
/web_query/`
export
const
WEB_QUERY_QUERY
=
`
${
TOOL_PROXY
}
/web_query/query/`
export
const
WEB_QUERY_QUERY_VALUE
=
`
${
TOOL_PROXY
}
/web_query/query_value/`
...
...
@@ -6,6 +6,7 @@ export const WEB_QUERY_PAGE = `${TOOL_PROXY}/web_chart_config/query_page/`
export
const
SQL_GQL
=
`
${
GQL_PROXY
}
/sql_gql/`
export
const
SQL_GQL_SAVE
=
`
${
GQL_PROXY
}
/sql_gql/save/`
export
const
TOOL_API
=
`
${
TOOL_PROXY
}
/api/`
export
const
SERVICE_API
=
`
${
SERVICE_PROXY
}
/`
// 单据流
export
const
AUDIT_BILLS
=
`
${
COMMON_UTIL_PROXY
}
/audit_bills/`
export
const
UN_AUDIT_BILLS
=
`
${
COMMON_UTIL_PROXY
}
/un_audit_bills/`
...
...
src/packages/common/commonProxy.js
View file @
66d3cc72
...
...
@@ -5,3 +5,4 @@ export const COMMON_UTIL_PROXY = 'COMMON_UTIL_PROXY' // `http://${api}/CommonUti
export
const
COMMON_PROXY
=
'COMMON_PROXY'
// `http://${api}/`
export
const
GQL_PROXY
=
'GQL_PROXY'
// `http://${api}/GQL/api/`
export
const
FILE_RESOURCE_PROXY
=
'FILE_RESOURCE_PROXY'
// `http://${api}/fileresource/api/`
export
const
SERVICE_PROXY
=
'SERVICE_PROXY'
// `SERVICE_PROXY`
src/packages/modules/restful.js
View file @
66d3cc72
import
{
TOOL_API
}
from
'../common/commonModule'
import
{
TOOL_API
,
SERVICE_API
}
from
'../common/commonModule'
class
RestFul
{
constructor
(
requestClient
)
{
constructor
(
requestClient
,
isService
)
{
this
.
requestClient
=
requestClient
this
.
moduleName
=
'RestFulModule'
// 如果isService 是字符串就直接试用这个字符串作为代理前缀,是不尔值:true就使用用默认的字符串:SERVICE_PROXY
const
typeof_isService
=
typeof
isService
if
(
typeof_isService
===
'boolean'
)
{
this
.
MODULEAPI
=
isService
?
SERVICE_API
:
TOOL_API
}
else
if
(
typeof_isService
===
'string'
&&
isService
)
{
this
.
MODULEAPI
=
isService
}
}
// 处理传入的data 如果有appCode dbName
packParamHandle
(
parms
)
{
...
...
@@ -23,7 +30,7 @@ class RestFul {
query
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
group
,
parms
,
bodyData
,
isQueryMaster
}
=
data
let
url
=
`
${
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
...
...
@@ -37,7 +44,7 @@ class RestFul {
save
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
}
=
data
let
url
=
`
${
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
...
...
@@ -46,7 +53,7 @@ class RestFul {
queryOne
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
id
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
TOOL_
API
}${
appCode
}
/
${
tableName
}
/
${
id
}
/`
let
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/
${
id
}
/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
...
...
@@ -60,7 +67,7 @@ class RestFul {
put
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
group
,
parms
,
isQueryMaster
}
=
data
let
url
=
`
${
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
let
url
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
// 非标准保存
url
=
`
${
url
}${
group
}
/`
}
...
...
@@ -68,10 +75,9 @@ class RestFul {
return
this
.
requestClient
.
put
(
url
,
bodyData
,
parms
,
header
)
}
queryList
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
parms
,
group
,
bodyData
,
isQueryMaster
}
=
data
let
url_
=
`
${
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
let
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
if
(
group
)
{
url_
=
`
${
url_
}${
group
}
/`
}
...
...
@@ -86,7 +92,7 @@ class RestFul {
deleteList
(
data
)
{
this
.
packParamHandle
(
data
)
const
{
tableName
,
appCode
,
bodyData
,
parms
}
=
data
const
url_
=
`
${
TOOL_
API
}${
appCode
}
/
${
tableName
}
/`
const
url_
=
`
${
MODULE
API
}${
appCode
}
/
${
tableName
}
/`
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