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
63de000a
Commit
63de000a
authored
Apr 09, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
2d7eb531
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
44 deletions
+119
-44
center-channel/app/base/api/impl/auth/accessAuth.js
+10
-1
center-channel/app/base/service/app.base.js
+1
-23
center-channel/app/base/service/impl/utilsSve/utilsTmAliyunSve.js
+106
-18
center-channel/app/config/routes/api.js
+1
-1
center-channel/app/front/entry/public/apidoc/platform/tmOrder.md
+1
-1
No files found.
center-channel/app/base/api/impl/auth/accessAuth.js
View file @
63de000a
...
...
@@ -5,6 +5,7 @@ class AccessAuthAPI extends WEBBase {
super
();
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
this
.
utilsNeedSve
=
system
.
getObject
(
"service.utilsSve.utilsNeedSve"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
//测试用
}
/**
* 接口跳转-POST请求
...
...
@@ -28,7 +29,15 @@ class AccessAuthAPI extends WEBBase {
switch
(
action_type
)
{
// sy
case
"test"
:
//测试
opResult
=
system
.
getResultSuccess
(
null
,
"测试成功"
);
var
rpcParam
=
{
accessKeyId
:
"LTAI4Fgz1uoUpfHpa79iq3XV"
,
accessKeySecret
:
"up8vlX0wzwCVtRAjKRXsCrFta6CHOY"
,
endpoint
:
"https://trademark.aliyuncs.com"
,
apiVersion
:
"2019-09-02"
};
opResult
=
await
this
.
utilsTmAliyunSve
.
getAliOssInfo
(
null
,
"ICON"
,
rpcParam
);
var
tmo
=
0
;
// opResult = system.getResultSuccess(null, "测试成功");
break
;
case
"getNeedUserPinByChannelUserId"
:
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户
var
tmpOpResult
=
await
this
.
utilsAuthSve
.
getLoginByUserName
(
pobj
,
pobj
.
actionBody
);
...
...
center-channel/app/base/service/app.base.js
View file @
63de000a
...
...
@@ -83,29 +83,7 @@ class AppServiceBase {
// var rpcParam = obj.rpcParam;
var
aliyunClient
=
system
.
getObject
(
"util.aliyunClient"
);
var
rtn
=
await
aliyunClient
.
reqCustomByGet
(
params
);
if
(
rtn
.
code
!=
200
&&
rtn
.
success
!=
true
)
{
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
op
:
JSON
.
stringify
(
pobj
.
interface_info
),
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
rtn
),
returnType
:
'0'
,
opTitle
:
pobj
.
opType
+
"推送操作出错->opAliyunClientPost"
});
return
system
.
getResult
(
null
,
"推送失败,失败原因:"
+
rtn
.
errorMsg
+
",requestId="
+
rtn
.
requestId
);
}
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
op
:
JSON
.
stringify
(
pobj
.
interface_info
),
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
JSON
.
stringify
(
rtn
),
returnType
:
'1'
,
opTitle
:
pobj
.
opType
+
"数据推送成功->opAliyunClientPost"
});
return
system
.
getResultSuccess
(
null
,
"推送成功"
);
return
rtn
;
}
catch
(
e
)
{
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
...
...
center-channel/app/base/service/impl/utilsSve/utilsTmAliyunSve.js
View file @
63de000a
...
...
@@ -4,9 +4,23 @@ const AppServiceBase = require("../../app.base");
class
UtilsTmAliyunService
extends
AppServiceBase
{
constructor
()
{
super
();
//ICON 图标图样,CARD 身份证,ATTORNEY 授权书ossKey,PASSPORT 护照,BUSINESS_LICENSE 营业执照,LEGAL_NOTICE 法律声明,SUPPLEMENT 补正图片的上传
this
.
aliOssFileType
=
{
ICON
:
"ICON"
,
CARD
:
"CARD"
,
ATTORNEY
:
"ATTORNEY"
,
PASSPORT
:
"PASSPORT"
,
BUSINESS_LICENSE
:
"BUSINESS_LICENSE"
,
LEGAL_NOTICE
:
"LEGAL_NOTICE"
,
SUPPLEMENT
:
"SUPPLEMENT"
};
}
async
tmCreateApplicant
(
pobj
)
{
//创建商标申请人信息
var
verify
=
await
this
.
opAliyunRpcVerifyParam
(
pobj
);
var
apply
=
pobj
.
actionBody
.
delivery_content
.
apply
;
var
orderContact
=
pobj
.
actionBody
.
delivery_content
.
orderContact
;
var
orderInfo
=
pobj
.
actionBody
.
order_info
;
if
(
!
orderInfo
)
{
verify
=
system
.
getResult
(
null
,
"orderInfo data is empty,100450"
);
}
if
(
Number
(
orderInfo
.
orderStatus
)
!=
2
)
{
verify
=
system
.
getResult
(
null
,
"orderInfo status is error,100453"
);
}
if
(
!
apply
)
{
verify
=
system
.
getResult
(
null
,
"apply data is empty,100455"
);
}
if
(
verify
.
status
!=
0
)
{
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
...
...
@@ -21,32 +35,106 @@ class UtilsTmAliyunService extends AppServiceBase {
return
verify
;
}
var
rpcParam
=
verify
.
data
;
var
idCardOssKey
=
""
;
var
businessLicenceOssKey
=
""
;
var
legalNoticeOssKey
=
""
;
if
(
apply
.
customerType
!=
"ent"
&&
apply
.
identityCardPic
)
{
idCardOssKey
=
await
this
.
getAliOssFileUrl
(
pobj
,
this
.
aliOssFileType
.
CARD
,
apply
.
identityCardPic
,
rpcParam
);
}
if
(
apply
.
customerType
==
"ent"
&&
apply
.
businessLicensePic
)
{
businessLicenceOssKey
=
await
this
.
getAliOssFileUrl
(
pobj
,
this
.
aliOssFileType
.
BUSINESS_LICENSE
,
apply
.
businessLicensePic
,
rpcParam
);
}
if
(
apply
.
smwjUrl
)
{
legalNoticeOssKey
=
await
this
.
getAliOssFileUrl
(
pobj
,
this
.
aliOssFileType
.
LEGAL_NOTICE
,
apply
.
smwjUrl
,
rpcParam
);
}
var
actionBody
=
{
ContactName
:
orderContact
.
contactName
||
""
,
//String 否 张三 联系人姓名
ContactNumber
:
orderContact
.
mobile
||
""
,
//String 否 18611112222 联系人电话
ContactEmail
:
orderContact
.
email
||
""
,
//String 否 test@alibaba.com 联系人邮箱
ContactZipcode
:
apply
.
zipCode
||
""
,
//String 否 100000 联系人邮编
// ContactAddress :orderContact.,//String 否 北京市朝阳区绿地中心A座 联系人地址
ApplicantType
:
apply
.
customerType
&&
apply
.
customerType
==
"ent"
?
2
:
1
,
//Integer 否 1 申请人类型 1, "个人";2, "企业"
ApplicantRegion
:
1
,
//Integer 否 1 阿拉伯数字 1, "中国大陆";2, "中国香港";3, "中国澳门";4, "中国台湾";5, "国外"
ApplicantName
:
apply
.
name
,
//String 否 张三 申请人名称
CardNumber
:
apply
.
customerType
&&
apply
.
customerType
==
"ent"
?
apply
.
code
:
apply
.
identityCardNo
,
//String 否 123456 证件号码
Address
:
apply
.
applyAddr
,
//String 否 北京市朝阳区绿地中心A座 申请人地址
IdCardOssKey
:
idCardOssKey
,
//String 否 1219541161213057/card/ujd8hthwfdk.png 身份证ossKey
BusinessLicenceOssKey
:
businessLicenceOssKey
,
//String 否 1219541161213057/business_license/gmzl6cvbk48.png 营业执照ossKey
LegalNoticeOssKey
:
legalNoticeOssKey
//String 否 1219541161213057/legal_notice/mlnpsjmaed.jpg 法律声明ossKey
// Province: apply.,//String 否 安徽省 省份
// EName: apply.,//String 否 zhang san 英文名称
// EAddress: apply.,//String 否 bei jing shi 英文地址
// Country: apply.,//String 否 2096 国家
// PassportOssKey: apply.,//String 否 1219541161213057/pass_port/gmzl16cvbk48.png 护照ossKey
// AuthorizationOssKey: apply.,//String 否 1219541161213057/attorney/gy378w6btam.jpg 授权书ossKey--联系了开发,创建申请人时不用填写,在创建商标时填写
};
var
params
=
{
action
:
rpcParam
.
action
,
reqbody
:
pobj
.
actionBody
,
reqbody
:
actionBody
,
rpcParam
:
rpcParam
}
this
.
opAliyunRpcReq
(
pobj
,
params
);
}
async
tmCreateTrademarkApplication
(
pobj
)
{
//创建商标申请信息
var
verify
=
await
this
.
opAliyunRpcVerifyParam
(
pobj
);
if
(
verify
.
status
!=
0
)
{
this
.
pushlogSve
.
createDb
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uapp_key
,
requestId
:
pobj
.
requestId
||
""
,
op
:
"暂无推送的接口信息"
+
",verify-msg:"
+
verify
.
msg
,
//推送的接口信息
content
:
JSON
.
stringify
(
pobj
),
//推送的参数信息
resultInfo
:
""
,
returnType
:
'0'
,
opTitle
:
pobj
.
opType
+
"推送操作失败->tmCreateTrademarkApplication"
});
return
verify
;
async
getAliOssFileUrl
(
pobj
,
fileType
,
selfFileUrl
,
rpcParam
)
{
var
fileUrl
=
""
;
var
resultInfo
=
await
this
.
getAliOssInfo
(
pobj
,
fileType
,
rpcParam
);
if
(
resultInfo
.
status
!=
0
)
{
return
fileUrl
;
}
var
rpcParam
=
verify
.
data
;
//TODO:上传文件到阿里云
}
async
getAliOssInfo
(
pobj
,
fileType
,
rpcParam
)
{
var
params
=
{
action
:
rpcParam
.
action
,
reqbody
:
pobj
.
actionBody
,
action
:
"GenerateUploadFilePolicy"
,
reqbody
:
{
FileType
:
fileType
},
rpcParam
:
rpcParam
}
var
resultInfo
=
this
.
opAliyunRpcReq
(
pobj
,
params
);
return
resultInfo
;
}
async
tmCreate
(
pobj
,
rpcParam
,
gzwtsUrl
,
classifications
,
applicantId
)
{
//创建商标申请信息
var
tmInfo
=
pobj
.
actionBody
.
delivery_content
.
tm
;
if
(
!
tmInfo
)
{
return
system
.
getResult
(
null
,
"tmInfo data is empty,100460"
);
}
var
picUrl
=
""
;
var
authorizationOssKey
=
""
;
if
(
tmInfo
.
picUrl
)
{
picUrl
=
await
this
.
getAliOssFileUrl
(
pobj
,
this
.
aliOssFileType
.
ICON
,
tmInfo
.
picUrl
,
rpcParam
);
}
if
(
gzwtsUrl
)
{
authorizationOssKey
=
await
this
.
getAliOssFileUrl
(
pobj
,
this
.
aliOssFileType
.
ATTORNEY
,
gzwtsUrl
,
rpcParam
);
}
// 商标类型形式: 3: 字, 4: 图, 5: 字图
var
trademarkNameType
=
1
;
if
(
tmInfo
.
tmFormType
==
"4"
)
{
trademarkNameType
=
2
;
}
if
(
tmInfo
.
tmFormType
==
"5"
)
{
trademarkNameType
=
3
;
tmInfo
.
tmName
=
tmInfo
.
tmName
+
"及图"
;
}
var
actionBody
=
{
TrademarkNameType
:
trademarkNameType
,
//String 否 1 商标申请类型 1-文字 2-图形 3-文字及图形
TrademarkName
:
tmInfo
.
tmName
,
//String 是 pop-test 商标名称
TrademarkComment
:
tmInfo
.
tmName
,
//String 否 测试 商标说明
TrademarkIcon
:
picUrl
,
//String 是 1219541161213057/icon/gii9s4oyg8.jpg 商标对应图案的ossKey,有彩色图标请填写彩色图标,没有请填写黑白图标
BlackAndWhiteIcon
:
picUrl
,
//String 否 1219541161213057/icon/gii9s4oyg8.jpg
ApplicationType
:
1
,
//Integer 否 1 固定值1
ApplicantId
:
applicantId
,
//String 否 111 申请人ID,通过申请人API创建申请人获得,或者通过申请人列表查询接口获得
Classifications
:
classifications
,
//String 是 {"38":"380005,380024,380050,380040,38020148,380004,38010007,38020149,38020141,380053"} 商标分类
AuthorizationOssKey
:
authorizationOssKey
,
//String 否 1219541161213057/attorney/9cgvhk2yd1l.JPG 授权书ossKey
Channel
:
"aliTmH5"
//String 否 pop接口测试 通道,调用方填写,独立标志,用于区分来源-自己随便定义
};
var
params
=
{
action
:
"tmCreateTrademarkApplication"
,
reqbody
:
actionBody
,
rpcParam
:
rpcParam
}
this
.
opAliyunRpcReq
(
pobj
,
params
);
...
...
center-channel/app/config/routes/api.js
View file @
63de000a
...
...
@@ -84,7 +84,7 @@ module.exports = function (app) {
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
if
([
"getAppTokenByHosts"
,
"getAppTokenByAppKey"
,
"test"
].
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
req
.
body
.
actionBody
.
appHosts
=
req
.
host
;
next
();
return
;
...
...
center-channel/app/front/entry/public/apidoc/platform/tmOrder.md
View file @
63de000a
...
...
@@ -75,7 +75,7 @@
"colorizedPicUrl"
:
"https://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_word2picb2bc98b9fc564ef2a1f4b3cbe9352f39.jpg"
,
//商标彩色图样
"tmName"
:
"testbiao"
,
//商标名称
"picUrl"
:
"https://gsb-zc.oss-cn-beijing.aliyuncs.com/zc_word2picb2bc98b9fc564ef2a1f4b3cbe9352f39.jpg"
,
//商标图样
"tmFormType"
:
"3"
//商标类型形式:
1: 立体, 3: 字, 4: 图, 5: 字图, 6: 颜色, 7: 彩色
"tmFormType"
:
"3"
//商标类型形式:
3: 字, 4: 图, 5: 字图
},
"nclones"
:
[
{
...
...
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