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
ce322bab
Commit
ce322bab
authored
Nov 18, 2020
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 代码格式
parent
e8df5b23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
37 deletions
+32
-37
ic-deliver/app/base/service/impl/msg/msghistorySve.js
+6
-6
ic-deliver/app/base/utils/restClient.js
+26
-31
No files found.
ic-deliver/app/base/service/impl/msg/msghistorySve.js
View file @
ce322bab
...
@@ -20,12 +20,12 @@ class MsgHistoryService extends ServiceBase {
...
@@ -20,12 +20,12 @@ class MsgHistoryService extends ServiceBase {
return
msg
;
return
msg
;
}
}
async
pushBusinessLicenseMsg
(
senderId
,
targetId
,
businessLicense
_i
d
)
{
async
pushBusinessLicenseMsg
(
senderId
,
targetId
,
businessLicense
I
d
)
{
if
(
!
businessLicense
_i
d
)
{
if
(
!
businessLicense
I
d
)
{
return
0
;
return
0
;
}
}
const
notice
=
await
this
.
msgnoticeDao
.
findOne
({
fromId
:
senderId
,
toId
:
targetId
});
const
notice
=
await
this
.
msgnoticeDao
.
findOne
({
fromId
:
senderId
,
toId
:
targetId
});
if
(
notice
&&
notice
.
businessLicense_id
==
businessLicense
_i
d
)
{
if
(
notice
&&
notice
.
businessLicense_id
==
businessLicense
I
d
)
{
return
0
;
return
0
;
}
}
...
@@ -43,14 +43,14 @@ class MsgHistoryService extends ServiceBase {
...
@@ -43,14 +43,14 @@ class MsgHistoryService extends ServiceBase {
senderId
,
senderId
,
target
,
target
,
targetId
,
targetId
,
content
:
businessLicense
_i
d
,
content
:
businessLicense
I
d
,
isRead
:
false
,
isRead
:
false
,
businessLicense_id
,
businessLicense_id
:
businessLicenseId
,
};
};
const
obj
=
await
this
.
saveMsg
(
msg
);
const
obj
=
await
this
.
saveMsg
(
msg
);
const
bl
=
await
this
.
businesslicenseDao
.
findById
(
businessLicense
_i
d
);
const
bl
=
await
this
.
businesslicenseDao
.
findById
(
businessLicense
I
d
);
msg
.
businessLicense
=
bl
;
msg
.
businessLicense
=
bl
;
msg
.
id
=
obj
.
id
;
msg
.
id
=
obj
.
id
;
msg
.
created_at
=
obj
.
created_at
;
msg
.
created_at
=
obj
.
created_at
;
...
...
ic-deliver/app/base/utils/restClient.js
View file @
ce322bab
...
@@ -10,55 +10,50 @@ class RestClient {
...
@@ -10,55 +10,50 @@ class RestClient {
this
.
cmdDownLoadFilePattern
=
'curl -G -o {fileName} {url}'
;
this
.
cmdDownLoadFilePattern
=
'curl -G -o {fileName} {url}'
;
this
.
cmdPostPattern2
=
'curl -k -H
\'
Content-type: application/x-www-form-urlencoded
\'
-d
\'
{data}
\'
{url}'
;
this
.
cmdPostPattern2
=
'curl -k -H
\'
Content-type: application/x-www-form-urlencoded
\'
-d
\'
{data}
\'
{url}'
;
this
.
cmdPostPatternWithAK
=
'curl -k -H
\'
Content-type: application/json
\'
-H
\'
AccessKey:{ak}
\'
-d
\'
{data}
\'
{url}'
;
this
.
cmdPostPatternWithAK
=
'curl -k -H
\'
Content-type: application/json
\'
-H
\'
AccessKey:{ak}
\'
-d
\'
{data}
\'
{url}'
;
// 云帐户
// this.cmdPostPattern3="curl -k -H 'Content-type: application/x-www-form-urlencoded' -H 'dealer-id:"+settings.apiconfig.yunzhanghuDealer_id()+"' -H 'request-id:"+parseInt(Date.now() / 1000)+"_gsb"+"' -d '{data}' {url}";
// this.cmdGetPattern3 = "curl {-G} -k {url} --header 'dealer-id:"+settings.apiconfig.yunzhanghuDealer_id()+"'";
// e签宝
// this.cmdPostPattern4="curl -k -H 'Content-type: application/json' -H 'X-Tsign-Open-App-Id:"+settings.apiconfig.eSignBaoAppId()+"' -H 'X-Tsign-Open-App-Secret:"+settings.apiconfig.eSignBaoAppKey()+"' -d '{data}' {url}";
// form-data形式post data参数类型 md5=2&data=1
// form-data形式post data参数类型 md5=2&data=1
this
.
cmdPostPattern5
=
'curl -k --data
\'
{data}
\'
{url}'
;
this
.
cmdPostPattern5
=
'curl -k --data
\'
{data}
\'
{url}'
;
}
}
FetchGetCmd
(
subData
,
url
)
{
FetchGetCmd
(
subData
,
url
)
{
const
cmd
=
this
.
cmdGetPattern
.
replace
(
/
\{\
-
G
\}
/g
,
'-G'
).
replace
(
/
\{
data
\}
/g
,
subData
)
const
cmd
=
this
.
cmdGetPattern
.
replace
(
/
\{
-G
\}
/g
,
'-G'
).
replace
(
/
\{
data
\}
/g
,
subData
)
.
replace
(
/
\{
url
\}
/g
,
url
);
.
replace
(
/
\{
url
\}
/g
,
url
);
return
cmd
;
return
cmd
;
}
}
FetchPostCmd
(
subData
,
url
)
{
FetchPostCmd
(
subData
,
url
)
{
const
data
=
JSON
.
stringify
(
subData
);
const
data
=
JSON
.
stringify
(
subData
);
const
cmd
=
this
.
cmdPostPattern
.
replace
(
const
cmd
=
this
.
cmdPostPattern
.
replace
(
/
\{
data
\}
/g
,
/
\{
data
\}
/g
,
data
,
data
,
).
replace
(
/
\{
url
\}
/g
,
url
);
).
replace
(
/
\{
url
\}
/g
,
url
);
return
cmd
;
return
cmd
;
}
}
FetchPostCmdWithAK
(
subData
,
url
,
acck
)
{
FetchPostCmdWithAK
(
subData
,
url
,
acck
)
{
const
data
=
JSON
.
stringify
(
subData
);
const
data
=
JSON
.
stringify
(
subData
);
const
cmd
=
this
.
cmdPostPatternWithAK
.
replace
(
const
cmd
=
this
.
cmdPostPatternWithAK
.
replace
(
/
\{
data
\}
/g
,
/
\{
data
\}
/g
,
data
,
data
,
).
replace
(
/
\{
url
\}
/g
,
url
)
).
replace
(
/
\{
url
\}
/g
,
url
)
.
replace
(
/
\{
ak
\}
/g
,
acck
);
.
replace
(
/
\{
ak
\}
/g
,
acck
);
return
cmd
;
return
cmd
;
}
}
FetchPostCmd2
(
subData
,
url
)
{
FetchPostCmd2
(
subData
,
url
)
{
const
data
=
subData
;
const
data
=
subData
;
const
cmd
=
this
.
cmdPostPattern2
.
replace
(
const
cmd
=
this
.
cmdPostPattern2
.
replace
(
/
\{
data
\}
/g
,
/
\{
data
\}
/g
,
data
,
data
,
).
replace
(
/
\{
url
\}
/g
,
url
);
).
replace
(
/
\{
url
\}
/g
,
url
);
return
cmd
;
return
cmd
;
}
}
FetchPostCmd3
(
subData
,
url
)
{
FetchPostCmd3
(
subData
,
url
)
{
const
data
=
subData
;
const
data
=
subData
;
const
cmd
=
this
.
cmdPostPattern3
.
replace
(
const
cmd
=
this
.
cmdPostPattern3
.
replace
(
/
\{
data
\}
/g
,
/
\{
data
\}
/g
,
data
,
data
,
).
replace
(
/
\{
url
\}
/g
,
url
);
).
replace
(
/
\{
url
\}
/g
,
url
);
return
cmd
;
return
cmd
;
}
}
FetchGetCmd3
(
url
)
{
FetchGetCmd3
(
url
)
{
const
cmd
=
this
.
cmdGetPattern3
.
replace
(
/
\{
\
-
G
\}
/g
,
'-G'
).
replace
(
/
\{
url
\}
/g
,
url
);
const
cmd
=
this
.
cmdGetPattern3
.
replace
(
/
\{
-G
\}
/g
,
'-G'
).
replace
(
/
\{
url
\}
/g
,
url
);
return
cmd
;
return
cmd
;
}
}
FetchPostCmd4
(
subData
,
url
)
{
FetchPostCmd4
(
subData
,
url
)
{
...
@@ -78,10 +73,10 @@ class RestClient {
...
@@ -78,10 +73,10 @@ class RestClient {
return
cmd
;
return
cmd
;
}
}
FetchDownLoadCmd
(
outfname
,
url
)
{
FetchDownLoadCmd
(
outfname
,
url
)
{
// console.log(this.cmdPattern);
// console.log(this.cmdPattern);
const
cmd
=
this
.
cmdDownLoadFilePattern
.
replace
(
/
\{
fileName
\}
/g
,
outfname
).
replace
(
/
\{
url
\}
/g
,
url
);
const
cmd
=
this
.
cmdDownLoadFilePattern
.
replace
(
/
\{
fileName
\}
/g
,
outfname
).
replace
(
/
\{
url
\}
/g
,
url
);
return
cmd
;
return
cmd
;
}
}
async
exec
(
cmd
)
{
async
exec
(
cmd
)
{
// await后面表达式返回的promise对象,是then的语法糖,await返回then函数的返回值
// await后面表达式返回的promise对象,是then的语法糖,await返回then函数的返回值
// 异常需要try/catch自己捕获或外部catch捕获
// 异常需要try/catch自己捕获或外部catch捕获
...
...
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