Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
d1638a61
Commit
d1638a61
authored
Jan 16, 2020
by
高宇强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
3e975747
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
4 deletions
+62
-4
igirl-zcapi/app/base/api/impl/action/enterpriseQuery.js
+3
-0
igirl-zcapi/app/base/service/impl/enterprise/enterpriseSve.js
+40
-4
igirl-zcapi/app/base/utils/restClient.js
+13
-0
igirl-zcapi/package-lock.json
+5
-0
igirl-zcapi/package.json
+1
-0
No files found.
igirl-zcapi/app/base/api/impl/action/enterpriseQuery.js
View file @
d1638a61
...
...
@@ -49,6 +49,9 @@ class EnterpriseQueryAPI extends APIBase {
case
"ipListByAuthor"
:
//获取企业域名信息列表
opResult
=
await
this
.
enterSve
.
ipListByAuthor
(
action_body
);
break
;
case
"getQccBranches"
:
//获取企业的分支机构(从企查查获取)
opResult
=
await
this
.
enterSve
.
getQccBranches
(
action_body
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
igirl-zcapi/app/base/service/impl/enterprise/enterpriseSve.js
View file @
d1638a61
const
System
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
var
md5
=
require
(
"md5-node"
);
const
querystring
=
require
(
'querystring'
);
class
EnterpriseService
{
constructor
()
{
...
...
@@ -7,6 +8,42 @@ class EnterpriseService {
this
.
licenseUrl
=
settings
.
reqEsAddrIc
()
+
"enterprise_chain_license/_search"
;
this
.
gameUrl
=
settings
.
reqEsAddrIc
()
+
"enterprise_chain_game/_search"
;
this
.
ipUrl
=
settings
.
reqEsAddrIc
()
+
"bigdata_ip_back/_search"
;
this
.
qccUrl
=
"http://api.qichacha.com/ECIV4/GetDetailsByName"
;
};
async
getQccBranches
(
obj
){
//获取企业的分支机构(从企查查获取)
var
author
=
obj
.
author
==
null
||
obj
.
author
==
""
||
obj
.
author
==
"undefined"
?
""
:
obj
.
author
;
if
(
author
==
""
)
{
return
System
.
getResult2
(
null
,
"企业名称不能为空"
);
}
author
=
await
this
.
getConvertSemiangleStr
(
author
);
var
Timespan
=
parseInt
(
Date
.
now
()
/
1000
);
//秒级时间戳
var
Token
=
md5
(
"74805b02bf2f46feaa3bdb24feecfbc1"
+
Timespan
.
toString
()
+
"5D92FB79060AFCBFD3D4BC7AE7A3D225"
);
Token
=
Token
.
toUpperCase
();
var
params
=
{
key
:
"74805b02bf2f46feaa3bdb24feecfbc1"
,
keyword
:
author
}
var
rc
=
System
.
getObject
(
"util.restClient"
);
var
data
=
querystring
.
stringify
(
params
);
var
rtn
=
null
;
try
{
rtn
=
await
rc
.
execGetZZ
(
params
,
this
.
qccUrl
,
Token
,
Timespan
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
Status
==
"200"
){
return
System
.
getResult2
(
result
.
Result
.
Branches
,
"获取数据出错"
);
}
else
if
(
result
.
Status
==
"201"
){
return
System
.
getResult2
(
null
,
"查询无结果"
);
}
else
{
return
System
.
getResult2
(
null
,
"获取数据出错"
);
}
}
catch
(
e
){
return
System
.
getResult2
(
null
,
"获取数据出错"
);
}
};
async
getConvertSemiangleStr
(
str
)
{
//半角转全角
...
...
@@ -458,12 +495,11 @@ module.exports = EnterpriseService;
// var tesk = new EnterpriseService();
// var parm = {
// author: "上海橙域网络科技有限公司",
// licence: "IDC许可证"
// author: "淘宝(中国)软件有限公司"
// };
// tesk.
licenseListByAuthor
(parm).then(function (result) {
// tesk.
getQccBranches
(parm).then(function (result) {
// console.log(result);
// console.log(result.data.data[0]);
//
//
console.log(result.data.data[0]);
// }).catch(function (e) {
// console.log(e);
// });
...
...
igirl-zcapi/app/base/utils/restClient.js
View file @
d1638a61
...
...
@@ -6,6 +6,7 @@ var settings = require("../../config/settings");
class
RestClient
{
constructor
()
{
this
.
cmdGetPattern
=
"curl {-G} -k -d '{data}' {url}"
;
this
.
cmdZZGet
=
"curl -G -k -H 'Token:{ak}' -H 'Timespan:{ts}' -d '{data}' {url}"
;
this
.
cmdPostPattern
=
"curl -k -H 'Content-type: application/json' -d '{data}' '{url}'"
;
this
.
cmdPostPatternWithAK
=
"curl -k -H 'Content-type: application/json' -H 'AccessKey:{ak}' -d '{data}' {url}"
;
...
...
@@ -16,6 +17,18 @@ class RestClient {
this
.
cmdPostPattern5
=
"curl -k --data '{data}' {url}"
;
}
async
execGetZZ
(
subData
,
url
,
acck
,
Timespan
)
{
let
cmd
=
this
.
FetchGetZZCmd
(
subData
,
url
,
acck
,
Timespan
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
FetchGetZZCmd
(
subData
,
url
,
acck
,
Timespan
)
{
var
data
=
querystring
.
stringify
(
subData
);
var
cmd
=
this
.
cmdZZGet
.
replace
(
/
\{
data
\}
/g
,
data
).
replace
(
/
\{
url
\}
/g
,
url
).
replace
(
/
\{
ak
\}
/g
,
acck
).
replace
(
/
\{
ts
\}
/g
,
Timespan
);
return
cmd
;
}
FetchGetCmd
(
subData
,
url
)
{
var
cmd
=
this
.
cmdGetPattern
.
replace
(
/
\{\-
G
\}
/g
,
"-G"
).
replace
(
/
\{
data
\}
/g
,
subData
).
replace
(
/
\{
url
\}
/g
,
url
);
...
...
igirl-zcapi/package-lock.json
View file @
d1638a61
...
...
@@ -4273,6 +4273,11 @@
"resolved"
:
"https://registry.npmjs.org/marked/-/marked-0.7.0.tgz"
,
"integrity"
:
"sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg=="
},
"md5-node"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npmjs.org/md5-node/-/md5-node-1.0.1.tgz"
,
"integrity"
:
"sha1-DiLQCdRr3JWx08XoyP7dwaXDqog="
},
"media-typer"
:
{
"version"
:
"0.3.0"
,
"resolved"
:
"https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"
,
...
...
igirl-zcapi/package.json
View file @
d1638a61
...
...
@@ -32,6 +32,7 @@
"
glob
"
:
"^7.1.6"
,
"
gm
"
:
"^1.23.1"
,
"
marked
"
:
"^0.7.0"
,
"
md5-node
"
:
"^1.0.1"
,
"
method-override
"
:
"^2.3.10"
,
"
moment
"
:
"^2.24.0"
,
"
mongoose
"
:
"^5.7.1"
,
...
...
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