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
1f4380d6
Commit
1f4380d6
authored
Jun 09, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
5f5d7db5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
31 deletions
+31
-31
queue-center/app/base/db/impl/opLogs/errorLogDao.js
+3
-3
queue-center/app/base/utils/esUtils.js
+24
-24
queue-center/app/config/localsettings.js
+4
-4
No files found.
queue-center/app/base/db/impl/opLogs/errorLogDao.js
View file @
1f4380d6
...
...
@@ -17,9 +17,9 @@ class ErrorLogDao extends Dao {
var
params
=
{
identify_code
:
actionBody
.
identifyCode
,
op_title
:
opTitle
,
push_content
:
actionBody
,
error_info
:
error
,
result_info
:
execResult
,
push_content
:
actionBody
||
null
,
error_info
:
error
||
null
,
result_info
:
execResult
||
null
,
request_id
:
actionBody
.
requestId
,
client_ip
:
actionBody
.
clientIp
||
""
,
created_at
:
new
Date
()
...
...
queue-center/app/base/utils/esUtils.js
View file @
1f4380d6
const
system
=
require
(
"../system"
);
const
util
=
require
(
'util'
);
const
axios
=
require
(
'axios'
);
//
const axios = require('axios');
class
EsUtils
{
constructor
()
{
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
...
...
@@ -49,32 +49,32 @@ class EsUtils {
async
execPostEs
(
queuedName
,
params
,
reqUrl
,
esName
,
esPwd
)
{
try
{
let
result
=
await
axios
({
// headers: {'Content-Type': 'application/x-www-form-urlencoded'},
headers
:
{
'Content-type'
:
'application/json'
,
'Authorization'
:
'Basic YWRtaW5lczphZG1pbkdTQmVzLg=='
},
method
:
'POST'
,
url
:
reqUrl
,
data
:
JSON
.
stringify
(
params
),
timeout
:
5000
});
if
(
result
.
status
==
201
)
{
return
system
.
getResultSuccess
();
}
//
let result = await axios({
//
// headers: {'Content-Type': 'application/x-www-form-urlencoded'},
//
headers: {
//
'Content-type': 'application/json',
//
'Authorization': 'Basic YWRtaW5lczphZG1pbkdTQmVzLg=='
//
},
//
method: 'POST',
//
url: reqUrl,
//
data: JSON.stringify(params),
//
timeout: 5000
//
});
//
if (result.status == 201) {
//
return system.getResultSuccess();
//
}
this
.
errorLogDao
.
addOpErrorLogs
(
queuedName
+
"执行execPostEs存在错误"
,
params
,
result
,
null
,
3
);
return
system
.
getResult
(
null
,
"执行execPostEs存在错误"
);
//
this.errorLogDao.addOpErrorLogs(queuedName + "执行execPostEs存在错误", params, result, null, 3);
//
return system.getResult(null, "执行execPostEs存在错误");
//方式二
// var rtn
= await this.execClient.execPostEs(params, reqUrl, esName, esPwd);
// if (!rtn || !rtn
.stdout) {
// return system.getResult(null, "execPostTimeOut data is empty"
);
// }
// var result = JSON.parse(rtn.stdout
);
// return result;
var
result
=
await
this
.
execClient
.
execPostEs
(
params
,
reqUrl
,
esName
,
esPwd
);
if
(
!
result
||
!
result
.
stdout
)
{
this
.
errorLogDao
.
addOpErrorLogs
(
queuedName
+
"执行execPostEs存在错误"
,
params
,
result
,
null
,
3
);
return
system
.
getResult
(
null
,
"执行execPostEs存在错误"
);
return
system
.
getResult
(
null
,
"execPostTimeOut data is empty"
);
}
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
console
.
log
(
error
.
stack
,
"......axios........."
);
this
.
errorLogDao
.
addOpErrorLogs
(
queuedName
+
"执行execPostEs存在异常"
,
params
,
null
,
error
.
stack
,
3
);
...
...
queue-center/app/config/localsettings.js
View file @
1f4380d6
var
settings
=
{
redis
:
{
host
:
"121.36.3.35"
,
port
:
6379
,
//
host: "43.247.184.32",
//
port: 8967,
//
host: "121.36.3.35",
//
port: 6379,
host
:
"43.247.184.32"
,
port
:
8967
,
password
:
"Gongsibao2018"
,
db
:
5
,
},
...
...
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