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
8e0b2768
Commit
8e0b2768
authored
Jul 31, 2020
by
wkliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test curl
parent
66e730cb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
rej-reex/app/base/api/impl/reportcb/rejcb.js
+8
-0
rej-reex/app/base/service/impl/reportcb/rejcbSve.js
+13
-0
rej-reex/app/base/utils/restClient.js
+19
-0
No files found.
rej-reex/app/base/api/impl/reportcb/rejcb.js
View file @
8e0b2768
...
...
@@ -74,6 +74,14 @@ class RejAPI extends APIBase {
}
}
async
testpost
()
{
try
{
console
.
log
(
'into'
)
return
await
this
.
rejcbSve
.
testpost
()
}
catch
(
error
)
{
}
}
classDesc
()
{
return
{
groupName
:
"auth"
,
...
...
rej-reex/app/base/service/impl/reportcb/rejcbSve.js
View file @
8e0b2768
...
...
@@ -5,6 +5,7 @@ class RejcbService extends ServiceBase {
super
()
this
.
tcDao
=
system
.
getObject
(
'db.rejreex.trademarkcaseDao'
)
this
.
bcDao
=
system
.
getObject
(
'db.common.bcdataDao'
)
this
.
restClient
=
system
.
getObject
(
"util.restClient"
)
this
.
isTest
=
true
}
...
...
@@ -171,5 +172,17 @@ class RejcbService extends ServiceBase {
async
initStatus
()
{
return
await
this
.
tcDao
.
model
.
update
({
rejStatus
:
"待提报"
},
{
where
:
{
caseId
:
{
[
this
.
db
.
Op
.
like
]:
`%TESTCB%`
}
}
})
}
async
testpost
()
{
console
.
log
(
'into'
)
let
url
=
'https://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_word2picb2bcb9fc564ef2a1f4b3cbe9352f39.jpg'
let
res
=
await
this
.
restClient
.
execGet
(
null
,
url
)
if
(
res
)
{
console
.
log
(
'1 '
)
}
else
{
console
.
log
(
' 2'
)
}
return
res
}
}
module
.
exports
=
RejcbService
;
rej-reex/app/base/utils/restClient.js
View file @
8e0b2768
...
...
@@ -93,9 +93,27 @@ class RestClient {
return
result
;
}
async
execGet
(
subData
,
url
)
{
console
.
log
(
settings
.
env
)
if
(
settings
.
env
==
'dev'
)
{
try
{
console
.
log
(
'get ??'
)
const
rs
=
await
axios
.
get
(
url
);
console
.
log
(
'rs --'
,
rs
,
' type --'
,
typeof
rs
)
const
ret
=
{
stdout
:
JSON
.
stringify
(
rs
.
data
)
}
return
ret
;
}
catch
(
error
)
{
console
.
log
(
error
.
response
.
status
)
}
}
try
{
let
cmd
=
this
.
FetchGetCmd
(
subData
,
url
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
catch
(
error
)
{
}
}
async
execGet2
(
subData
,
url
)
{
var
data
=
querystring
.
stringify
(
subData
);
...
...
@@ -106,6 +124,7 @@ class RestClient {
async
execPost
(
subData
,
url
)
{
if
(
settings
.
env
==
'dev'
)
{
const
rs
=
await
axios
.
post
(
url
,
subData
);
console
.
log
(
rs
)
const
ret
=
{
stdout
:
JSON
.
stringify
(
rs
.
data
)
}
...
...
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