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
d87fc746
Commit
d87fc746
authored
Sep 08, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
b2ac9897
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
3 deletions
+72
-3
center-channel/app/base/api/impl/auth/taskapi.js
+6
-0
center-channel/app/base/service/impl/utilsSve/utilsTmOrderCallSve.js
+42
-2
center-channel/app/base/utils/aliyunClient.js
+16
-1
center-channel/app/config/settings.js
+8
-0
No files found.
center-channel/app/base/api/impl/auth/taskapi.js
View file @
d87fc746
...
...
@@ -9,6 +9,7 @@ class AccessAuthAPI extends APIBase {
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
}
async
taskAliIcapi
()
{
var
rtn
=
await
this
.
gatewaypushlogSve
.
taskAliIcapi
();
...
...
@@ -34,6 +35,11 @@ class AccessAuthAPI extends APIBase {
return
rtn
;
}
async
taskAlijsonfile
(
pobj
,
qobj
,
req
)
{
//操作阿里商标交易上架
var
rtn
=
await
this
.
UtilsTmOrderCallService
.
createjsonfile
();
return
rtn
;
}
async
taskAliRpcAgainPush
(
pobj
,
qobj
,
req
)
{
var
result
=
await
this
.
pushlogSve
.
getFailLogList
();
if
(
result
.
status
!=
0
||
!
result
.
data
||
result
.
data
.
length
==
0
)
{
...
...
center-channel/app/base/service/impl/utilsSve/utilsTmOrderCallSve.js
View file @
d87fc746
...
...
@@ -3,13 +3,53 @@ var settings = require("../../../../config/settings");
const
querystring
=
require
(
'querystring'
);
const
AppServiceBase
=
require
(
"../../app.base"
);
//订单操作类
class
Utils
OpOrder
Service
extends
AppServiceBase
{
class
Utils
TmOrderCall
Service
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
}
async
queryTradeProduceList
(
pobj
,
actionBody
)
{
//修改联系人
return
system
.
getResultSuccess
();
}
async
createjsonfile
()
{
var
self
=
this
;;
var
gobj
=
{
action
:
"GenerateUploadFilePolicy"
,
reqbody
:
{
FileType
:
"PARTNER_SYNC_FILE"
},
type
:
'TM'
}
var
rst
=
await
self
.
aliclient
.
reqbyget
(
gobj
);
console
.
log
(
rst
);
var
obj
=
{
actionType
:
"createjsonfile"
,
actionBody
:{}
}
var
getjsonurl
=
settings
.
tmtransactionUrl
()
+
"/api/action/trademarktransaction"
var
jsonurl
=
await
this
.
restPostUrl
(
obj
,
getjsonurl
);
if
(
!
jsonurl
){
return
system
.
getResultSuccess
();
}
var
upobj
=
{
ossurl
:
jsonurl
.
data
.
url
,
filedir
:
rst
.
data
.
FileDir
,
objectName
:
jsonurl
.
data
.
name
,
encodePolicy
:
rst
.
data
.
EncodedPolicy
,
endpoint
:
"http://partner-sync-file.oss-cn-beijing.aliyuncs.com"
,
accessKeyId
:
rst
.
data
.
AccessId
,
bucketName
:
"partner-sync-file"
}
var
aliOssFileInfo
=
await
this
.
execPostUrl
(
upobj
,
settings
.
aliossjavaUrl
());
if
(
aliOssFileInfo
==
true
)
{
var
fileUrl
=
params
.
filedir
+
"/"
+
params
.
objectName
;
return
system
.
getResultSuccess
(
fileUrl
);
}
}
}
module
.
exports
=
UtilsOpOrderService
;
module
.
exports
=
UtilsTmOrderCallService
;
// var a=new UtilsTmOrderCallService();
// a.createjsonfile();
center-channel/app/base/utils/aliyunClient.js
View file @
d87fc746
...
...
@@ -14,6 +14,15 @@ class aliyunClient {
apiVersion
:
"2020-03-06"
});
}
getAliTMClient
()
{
return
new
RPCClient
({
accessKeyId
:
'LTAI4FmyipY1wuLHjLhMWiPa'
,
accessKeySecret
:
'hp4FF18IDCSym1prqzxrAjnnhNH3ju'
,
endpoint
:
'https://trademark.aliyuncs.com'
,
apiVersion
:
'2018-07-24'
}
);
}
async
post
(
aliReqUrl
,
key
,
secret
,
actionBody
)
{
const
client
=
new
Client
(
key
,
secret
);
var
param
=
{
...
...
@@ -32,8 +41,14 @@ class aliyunClient {
async
reqbyget
(
obj
,
cbk
)
{
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
var
self
=
this
;
try
{
var
reqAliclient
=
this
.
getAliClient
();
// { ... this.aliclient };
var
reqAliclient
=
null
;
// { ... this.aliclient };
if
(
obj
.
type
&&
obj
.
type
==
"TM"
){
reqAliclient
=
self
.
getAliTMClient
();
}
else
{
reqAliclient
=
self
.
getAliClient
();
}
if
(
obj
.
apiVersion
)
{
reqAliclient
.
apiVersion
=
obj
.
apiVersion
;
}
...
...
center-channel/app/config/settings.js
View file @
d87fc746
...
...
@@ -51,6 +51,14 @@ var settings = {
return
"http://aliossjava-service/uploadfile"
;
}
},
tmtransactionUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.2.109:8080/uploadfile"
;
}
else
{
return
"http://center-tmtransaction-service"
;
}
},
qifuPayAfterH5JumpUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://tm.qifu.gongsibao.com:4012/#/home/indent_list"
;
...
...
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