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
b569d9a8
Commit
b569d9a8
authored
Feb 17, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'scratch-web' of gitlab.gongsibao.com:jiangyong/zhichan into scratch-web
parents
0537dd77
d65e6070
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 @
b569d9a8
var
childproc
=
require
(
'child_process'
);
const
util
=
require
(
'util'
);
const
exec
=
util
.
promisify
(
require
(
'child_process'
).
exec
);
const
uuidv4
=
require
(
'uuid/v4'
);
class
ExecClient
{
constructor
()
{
this
.
cmdPostPattern
=
"curl --user admines:adminGSBes. -k -H 'Content-type: application/json' -d '{data}' {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
)
{
...
...
@@ -69,6 +71,26 @@ class ExecClient {
const
{
stdout
,
stderr
}
=
await
exec
(
cmd
,
options
);
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
;
...
...
scratch-web/app/base/wxapplet/impl/businesschanceApplet.js
View file @
b569d9a8
This diff is collapsed.
Click to expand it.
scratch-web/app/config/localsettings.js
View file @
b569d9a8
...
...
@@ -7,11 +7,11 @@ var settings={
},
database
:{
dbname
:
"zc"
,
user
:
"
root
"
,
password
:
"
123456
"
,
user
:
"
write
"
,
password
:
"
write
"
,
config
:
{
host
:
'
192.168.4.119
'
,
port
:
3306
,
host
:
'
43.247.184.35
'
,
port
:
8899
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
pool
:
{
...
...
scratch-web/app/config/settings.js
View file @
b569d9a8
...
...
@@ -38,6 +38,13 @@ var settings = {
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
(){
if
(
this
.
env
==
"dev"
){
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