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
56158abf
Commit
56158abf
authored
Feb 14, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
e652d043
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
5 deletions
+34
-5
scratch-web/app/base/utils/execClient.js
+23
-1
scratch-web/app/base/wxapplet/impl/businesschanceApplet.js
+0
-0
scratch-web/app/config/localsettings.js
+4
-4
scratch-web/app/config/settings.js
+7
-0
No files found.
scratch-web/app/base/utils/execClient.js
View file @
56158abf
var
childproc
=
require
(
'child_process'
);
var
childproc
=
require
(
'child_process'
);
const
util
=
require
(
'util'
);
const
util
=
require
(
'util'
);
const
exec
=
util
.
promisify
(
require
(
'child_process'
).
exec
);
const
exec
=
util
.
promisify
(
require
(
'child_process'
).
exec
);
const
uuidv4
=
require
(
'uuid/v4'
);
class
ExecClient
{
class
ExecClient
{
constructor
()
{
constructor
()
{
this
.
cmdPostPattern
=
"curl --user admines:adminGSBes. -k -H 'Content-type: application/json' -d '{data}' {url}"
;
this
.
cmdPostPattern
=
"curl --user admines:adminGSBes. -k -H 'Content-type: application/json' -d '{data}' {url}"
;
this
.
cmdGetPattern
=
"curl -G -X GET '{url}'"
;
this
.
cmdGetPattern
=
"curl -G -X GET '{url}'"
;
this
.
cmdPushDataPostPattern
=
"curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}"
;
}
}
async
exec
(
cmd
)
{
async
exec
(
cmd
)
{
...
@@ -69,6 +71,26 @@ class ExecClient {
...
@@ -69,6 +71,26 @@ class ExecClient {
const
{
stdout
,
stderr
}
=
await
exec
(
cmd
,
options
);
const
{
stdout
,
stderr
}
=
await
exec
(
cmd
,
options
);
return
{
stdout
,
stderr
};
return
{
stdout
,
stderr
};
}
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
FetchPushDataPostCmd
(
subData
,
url
,
token
,
requestId
)
{
var
requestId
=
requestId
||
this
.
getUUID
();
var
data
=
JSON
.
stringify
(
subData
);
var
cmd
=
this
.
cmdPushDataPostPattern
.
replace
(
/
\{
data
\}
/g
,
data
).
replace
(
/
\{
url
\}
/g
,
url
).
replace
(
/
\{
tk
\}
/g
,
token
).
replace
(
/
\{
requestId
\}
/g
,
requestId
);
console
.
log
(
cmd
);
return
cmd
;
}
async
execPushDataPost
(
subData
,
url
,
token
,
requestId
)
{
let
cmd
=
this
.
FetchPushDataPostCmd
(
subData
,
url
,
token
,
requestId
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
}
}
module
.
exports
=
ExecClient
;
module
.
exports
=
ExecClient
;
...
...
scratch-web/app/base/wxapplet/impl/businesschanceApplet.js
View file @
56158abf
This diff is collapsed.
Click to expand it.
scratch-web/app/config/localsettings.js
View file @
56158abf
...
@@ -7,11 +7,11 @@ var settings={
...
@@ -7,11 +7,11 @@ var settings={
},
},
database
:{
database
:{
dbname
:
"zc"
,
dbname
:
"zc"
,
user
:
"
root
"
,
user
:
"
write
"
,
password
:
"
123456
"
,
password
:
"
write
"
,
config
:
{
config
:
{
host
:
'
192.168.4.119
'
,
host
:
'
43.247.184.35
'
,
port
:
3306
,
port
:
8899
,
dialect
:
'mysql'
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
operatorsAliases
:
false
,
pool
:
{
pool
:
{
...
...
scratch-web/app/config/settings.js
View file @
56158abf
...
@@ -38,6 +38,13 @@ var settings = {
...
@@ -38,6 +38,13 @@ var settings = {
return
"http://43.247.184.94:7200/"
;
return
"http://43.247.184.94:7200/"
;
}
}
},
},
centerChannelUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://gsb.qifu.gongsibao.com:4012/"
;
}
else
{
return
"http://center-channel-service/"
;
}
},
reqEsAddrIc
:
function
(){
reqEsAddrIc
:
function
(){
if
(
this
.
env
==
"dev"
){
if
(
this
.
env
==
"dev"
){
var
localsettings
=
require
(
"./localsettings"
);
var
localsettings
=
require
(
"./localsettings"
);
...
...
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