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
2ac5f39c
Commit
2ac5f39c
authored
May 20, 2021
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加windows访问curl的json格式
parent
2ce0c4df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
28 deletions
+41
-28
igirl-channel-gateway/app/base/utils/execClient.js
+19
-6
igirl-channel-gateway/app/config/localsettings.js
+22
-22
No files found.
igirl-channel-gateway/app/base/utils/execClient.js
View file @
2ac5f39c
...
...
@@ -13,8 +13,8 @@ class ExecClient {
async
exec
(
cmd
)
{
//await后面表达式返回的promise对象,是then的语法糖,await返回then函数的返回值
//异常需要try/catch自己捕获或外部catch捕获
const
{
stdout
,
stderr
}
=
await
exec
(
cmd
);
return
{
stdout
,
stderr
};
const
{
stdout
,
stderr
}
=
await
exec
(
cmd
);
return
{
stdout
,
stderr
};
}
getUUID
()
{
...
...
@@ -59,7 +59,7 @@ class ExecClient {
}
async
exec2
(
cmd
)
{
return
exec
(
cmd
,
{
encoding
:
"base64"
});
return
exec
(
cmd
,
{
encoding
:
"base64"
});
}
FetchPostCmd
(
subData
,
url
)
{
...
...
@@ -71,9 +71,22 @@ class ExecClient {
}
async
execPost
(
subData
,
url
)
{
//本机windows curl json格式
// if (settings.env == 'dev') {
// const rs = await axios.post(url, subData, {
// auth: {
// username: "admines",
// password: "adminGSBes"
// }
// });
// const ret = {
// stdout: JSON.stringify(rs.data)
// }
// return ret;
// }
let
cmd
=
this
.
FetchPostCmd
(
subData
,
url
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
...
...
@@ -109,8 +122,8 @@ class ExecClient {
var
options
=
{
timeout
:
timeOut
,
};
const
{
stdout
,
stderr
}
=
await
exec
(
cmd
,
options
);
return
{
stdout
,
stderr
};
const
{
stdout
,
stderr
}
=
await
exec
(
cmd
,
options
);
return
{
stdout
,
stderr
};
}
}
...
...
igirl-channel-gateway/app/config/localsettings.js
View file @
2ac5f39c
var
settings
=
{
redis
:{
var
settings
=
{
redis
:
{
host
:
"43.247.184.32"
,
port
:
8967
,
password
:
"Gongsibao2018"
,
db
:
10
,
db
:
10
,
},
database
:{
dbname
:
"igirl_api"
,
database
:
{
dbname
:
"igirl_api"
,
user
:
"write"
,
password
:
"write"
,
config
:
{
host
:
'43.247.184.35'
,
port
:
8899
,
dialect
:
'mysql'
,
operatorsAliases
:
false
,
pool
:
{
max
:
5
,
min
:
0
,
acquire
:
90000000
,
idle
:
1000000
},
debug
:
false
,
dialectOptions
:
{
requestTimeout
:
999999
,
// instanceName:'DEV'
}
//设置MSSQL超时时间
}
},
reqEsDevUrl
:
"http://192.168.4.249:9200/"
,
reqHomePageDevUrl
:
"http://zcapi.apps.com:4002/"
,
reqAuthUrl
:
"http://sj.app.com:4002/auth"
operatorsAliases
:
false
,
pool
:
{
max
:
5
,
min
:
0
,
acquire
:
90000000
,
idle
:
1000000
},
debug
:
false
,
dialectOptions
:
{
requestTimeout
:
999999
,
// instanceName:'DEV'
}
//设置MSSQL超时时间
}
},
reqEsDevUrl
:
"http://192.168.4.249:9200/"
,
reqHomePageDevUrl
:
"http://zcapi.apps.com:4002/"
,
reqAuthUrl
:
"http://sj.app.com:4002/auth"
};
module
.
exports
=
settings
;
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