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
e930017a
Commit
e930017a
authored
May 09, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
0a38ebd3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
32 deletions
+13
-32
center-channel/app/base/api/impl/action/tmQuery.js
+2
-2
center-channel/app/base/api/impl/action/tmTools.js
+1
-1
center-channel/app/base/service/impl/trademark/toolSve.js
+10
-29
No files found.
center-channel/app/base/api/impl/action/tmQuery.js
View file @
e930017a
...
...
@@ -91,8 +91,8 @@ class TmQueryAPI extends WEBBase {
case
"icheming"
:
//商标智能分析 -----
opResult
=
await
this
.
toolSve
.
icheming
(
action_body
,
req
);
break
;
case
"tmreport"
:
//商标报告
opResult
=
await
this
.
tmquerySve
.
tmreport
(
action_body
,
req
);
case
"tmreport"
:
//商标报告
--TODO:后期将要迁移到center-service
opResult
=
await
this
.
tmquerySve
.
tmreport
(
action_body
,
req
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
center-channel/app/base/api/impl/action/tmTools.js
View file @
e930017a
...
...
@@ -34,7 +34,7 @@ class TmToolsAPI extends WEBBase {
case
"decryptStr"
:
//
opResult
=
await
this
.
toolSve
.
decryptStr
(
req
.
app
,
action_body
.
opStr
);
break
;
case
"getOssConfig"
:
//
case
"getOssConfig"
:
//
获取oss信息
opResult
=
await
this
.
toolSve
.
getOssConfig
();
break
;
case
"getNcl"
:
//尼斯查询(一)
...
...
center-channel/app/base/service/impl/trademark/toolSve.js
View file @
e930017a
const
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
crypto
=
require
(
'crypto'
);
const
cryptoJS
=
require
(
"crypto-js"
);
var
fs
=
require
(
"fs"
);
var
accesskey
=
'DHmRtFlw2Zr3KaRwUFeiu7FWATnmla'
;
var
accessKeyId
=
'LTAIyAUK8AD04P5S'
;
var
url
=
"https://gsb-zc.oss-cn-beijing.aliyuncs.com"
;
class
ToolService
{
class
ToolService
extends
AppServiceBase
{
constructor
()
{
super
();
this
.
zcApiUrl
=
settings
.
reqZcApi
();
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
//
this.execClient = system.getObject("util.execClient");
}
async
getCropperPic
(
obj
,
req
)
{
var
url
=
this
.
zcApiUrl
+
"api/tool/toolApi/getCropperPic"
;
...
...
@@ -79,29 +78,11 @@ class ToolService {
return
data
;
}
async
getOssConfig
(
queryobj
,
req
)
{
var
policyText
=
{
"expiration"
:
"2119-12-31T16:00:00.000Z"
,
"conditions"
:
[
[
"content-length-range"
,
0
,
1048576000
],
[
"starts-with"
,
"$key"
,
"zc"
]
]
};
var
b
=
new
Buffer
(
JSON
.
stringify
(
policyText
));
var
policyBase64
=
b
.
toString
(
'base64'
);
var
signature
=
crypto
.
createHmac
(
'sha1'
,
accesskey
).
update
(
policyBase64
).
digest
().
toString
(
'base64'
);
//base64
var
data
=
{
OSSAccessKeyId
:
accessKeyId
,
policy
:
policyBase64
,
Signature
:
signature
,
Bucket
:
'gsb-zc'
,
success_action_status
:
201
,
url
:
url
};
return
system
.
getResultSuccess
(
data
);
};
async
getOssConfig
(
pobj
,
req
)
{
//获取oss信息
var
reqUrl
=
settings
.
centerAppUrl
()
+
"auth/accessAuth/getOssInfo"
;
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
}
//加密信息
async
encryptStr
(
app
,
opStr
)
{
if
(
!
opStr
)
{
...
...
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