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
4ed15565
Commit
4ed15565
authored
Dec 17, 2020
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统一模块化
parent
9623badd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
index.js
src/index.js
+11
-10
root.js
src/root.js
+1
-0
No files found.
src/index.js
View file @
4ed15565
...
...
@@ -7,7 +7,8 @@ import System from './packages/modules/system'
import
WebQueryClient
from
'./packages/modules/webQueryClient'
import
Ref
from
'./packages/modules/ref'
class
HttpClient
{
constructor
(
axios
){
constructor
(
axios
)
{
this
.
axios
=
axios
const
root
=
new
Root
(
axios
)
const
restful
=
new
Restful
(
root
)
const
webQueryClient
=
new
WebQueryClient
(
root
)
...
...
@@ -15,20 +16,20 @@ class HttpClient {
const
system
=
new
System
(
root
,
restful
)
const
webChartConfig
=
new
WebChartConfig
(
root
)
const
ref
=
new
Ref
(
root
)
const
list
=
[
webQueryClient
,
billflow
,
system
,
webChartConfig
,
restful
,
ref
]
const
list
=
[
root
,
webQueryClient
,
billflow
,
system
,
webChartConfig
,
restful
,
ref
]
// const api = {
// }
list
.
forEach
(
item
=>
{
this
[
item
.
moduleName
]
=
item
})
const
root_prototype
=
root
.
__proto__
const
root_prototype_keys
=
Object
.
getOwnPropertyNames
(
root_prototype
)
root_prototype_keys
.
forEach
(
k
=>
{
if
(
k
!==
'constructor'
)
{
this
[
`
${
k
}
`
]
=
root_prototype
[
k
]
}
})
}
//
const root_prototype = root.__proto__
//
const root_prototype_keys = Object.getOwnPropertyNames(root_prototype)
//
root_prototype_keys.forEach(k => {
//
if (k !== 'constructor') {
//
this[`${k}`] = root_prototype[k]
//
}
//
})
}
}
export
default
HttpClient
src/root.js
View file @
4ed15565
import
axios
from
'axios'
class
Root
{
constructor
(
_axios
)
{
this
.
moduleName
=
'rootModule'
this
.
axios
=
_axios
||
axios
}
filterEmptyValue
(
obj
)
{
...
...
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