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
1d6f19de
Commit
1d6f19de
authored
May 09, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
tj
parents
e930017a
1b1e1a18
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
61 deletions
+67
-61
center-channel/app/base/api/impl/action/tmQuery.js
+10
-0
center-channel/app/base/service/impl/common/feishuLoginSve.js
+47
-2
center-channel/app/base/service/impl/trademark/tmquerySve.js
+2
-6
center-channel/app/base/service/impl/utilsSve/utilsFeishuSve.js
+6
-0
center-channel/app/config/routes/api.js
+1
-52
center-channel/app/front/entry/public/apidoc/opTrademark/tmSearch.md
+1
-1
No files found.
center-channel/app/base/api/impl/action/tmQuery.js
View file @
1d6f19de
...
...
@@ -91,8 +91,18 @@ class TmQueryAPI extends WEBBase {
case
"icheming"
:
//商标智能分析 -----
opResult
=
await
this
.
toolSve
.
icheming
(
action_body
,
req
);
break
;
<<<<<<<
HEAD
case
"tmreport"
:
//商标报告--TODO:后期将要迁移到center-service
opResult
=
await
this
.
tmquerySve
.
tmreport
(
action_body
,
req
);
=======
case
"tmreport"
:
//商标报告
var
rtn
=
await
this
.
tmquerySve
.
tmreport
(
action_body
,
req
);
if
(
rtn
.
code
>
0
){
opResult
=
system
.
getResultSuccess
();
}
else
{
opResult
=
system
.
getResultFail
();
}
>>>>>>>
1
b1e1a18ad0965b4585d785aad9aeea26232862b
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
center-channel/app/base/service/impl/common/feishuLoginSve.js
View file @
1d6f19de
...
...
@@ -4,6 +4,7 @@ var settings = require("../../../../config/settings");
class
feishuLoginService
{
constructor
()
{
this
.
utilsFeishuSve
=
system
.
getObject
(
"service.utilsSve.utilsFeishuSve"
);
this
.
utilsAuthSve
=
system
.
getObject
(
"service.utilsSve.utilsAuthSve"
);
};
//用户登录
async
checkAndLogin
(
pobj
){
...
...
@@ -28,6 +29,18 @@ class feishuLoginService{
}
var
userAccessTokenObj
=
userAccessTokenRes
.
data
;
//帐号登录---若用户信息已存在 则返回userpin 不存在则返回空
var
loginByUserNameParams
=
{
"actionType"
:
"getLoginByUserName"
,
"actionBody"
:
{
"open_id"
:
userAccessTokenObj
.
open_id
}
};
var
loginByUserNameRes
=
await
this
.
getLoginByUserName
(
loginByUserNameParams
);
if
(
loginByUserNameRes
&&
loginByUserNameRes
.
status
==
0
){
return
loginByUserNameRes
;
//获取userpin直接返回
}
//获取飞书用户信息
var
userInfoParams
=
{
user_access_token
:
userAccessTokenObj
.
access_token
...
...
@@ -38,9 +51,40 @@ class feishuLoginService{
}
var
userInfoObj
=
userInfoRes
.
data
;
var
createUserParams
=
{
// uapp_id,channel_userid,channel_username,channel_nickname,open_id,he
};
loginByUserNameParams
=
{
"actionType"
:
"getLoginByUserName"
,
"actionBody"
:
{
"open_id"
:
userAccessTokenObj
.
open_id
,
"channelUserId"
:
userInfoObj
.
mobile
,
// Y 渠道用户ID
"channelUserName"
:
userInfoObj
.
name
,
// N 渠道用户名
"mobile"
:
userInfoObj
.
mobile
,
// N 渠道用户手机号
"nickName"
:
userInfoObj
.
name
,
// N 用户昵称
"email"
:
userInfoObj
.
eamil
,
//邮箱
"head_url"
:
userInfoObj
.
avatar_url
//头像
}
};
loginByUserNameRes
=
await
this
.
getLoginByUserName
(
loginByUserNameParams
);
if
(
loginByUserNameRes
&&
loginByUserNameRes
.
status
==
0
){
return
loginByUserNameRes
;
//获取userpin直接返回
}
return
system
.
getResultFail
(
"获取userpin失败"
);
}
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户------>供后端调用
async
getLoginByUserName
(
pobj
){
var
tmpOpResult
=
await
this
.
utilsAuthSve
.
getLoginByUserName
(
pobj
,
pobj
.
actionBody
);
if
(
tmpOpResult
.
status
!=
0
&&
tmpOpResult
.
status
!=
2060
)
{
return
tmpOpResult
;
}
opResult
=
system
.
getResultSuccess
({
userpin
:
pobj
.
actionBody
.
userpin
})
if
(
tmpOpResult
.
status
==
2060
)
{
opResult
.
msg
=
tmpOpResult
.
msg
;
opResult
.
data
.
userpin
=
tmpOpResult
.
data
.
userpin
;
}
return
opResult
;
}
}
module
.
exports
=
feishuLoginService
;
\ No newline at end of file
center-channel/app/base/service/impl/trademark/tmquerySve.js
View file @
1d6f19de
...
...
@@ -74,7 +74,7 @@ class TmqueryService {
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
}
async
tmreport
(
queryobj
,
req
){
async
tmreport
(
queryobj
,
req
)
{
var
url
=
settings
.
igirlWeburl
()
+
"web/toolCtl/createMonitoringReportH5p"
;
return
await
this
.
opReqResult
(
url
,
queryobj
,
req
);
}
...
...
@@ -82,11 +82,7 @@ class TmqueryService {
async
opReqResult
(
reqUrl
,
queryobj
,
req
)
{
var
rtn
=
await
this
.
execClient
.
execPushDataPost
(
queryobj
,
reqUrl
,
req
.
headers
[
"token"
],
req
.
headers
[
"request-id"
]);
var
data
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
data
.
code
>
0
){
return
system
.
getResultSuccess
();
}
else
{
return
system
.
getResultFail
();
}
return
data
;
}
}
...
...
center-channel/app/base/service/impl/utilsSve/utilsFeishuSve.js
View file @
1d6f19de
...
...
@@ -31,6 +31,7 @@ class UtilsFeishuService{
return
system
.
getResultFail
(
"未知事件"
);
}
}
return
system
.
getResultFail
(
"未知事件"
);
}
//订阅验证
async
subscribeVerification
(
pobj
){
...
...
@@ -151,3 +152,8 @@ class UtilsFeishuService{
}
}
module
.
exports
=
UtilsFeishuService
;
// var task = new UtilsFeishuService();
// task.resendAppTicket().then(res=>{
// console.log(res,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
// })
center-channel/app/config/routes/api.js
View file @
1d6f19de
...
...
@@ -326,58 +326,7 @@ module.exports = function (app) {
//-----------------------新的模式---------api---------结束
//----------------------飞书小程序---------------------------------------------开始
//接收appTicket信息
app
.
use
(
'/feishu/appTicket'
,
async
function
(
req
,
res
)
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsFeishuSve
.
receiveAppTicket
(
req
.
body
);
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"飞书小程序记录回调处理结果:,method=appTicket"
,
op
:
"app/config/routes/api.js/feishu/appTicket"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
});
if
(
result
.
status
!=
0
)
{
return
res
.
end
(
"FAIL"
);
}
return
res
.
end
(
"success"
);
}
catch
(
error
)
{
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"飞书小程序记录回调处理结果异常,method=appTicket"
,
op
:
"app/config/routes/api.js/feishu/appTicket"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
});
}
});
//订阅验证
app
.
use
(
'/feishu/subscribeVerification'
,
async
function
(
req
,
res
)
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsFeishuSve
.
subscribeVerification
(
req
.
body
);
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"飞书小程序记录回调处理结果,method=subscribeVerification"
,
op
:
"app/config/routes/api.js/feishu/subscribeVerification"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
});
if
(
result
.
status
!=
0
)
{
return
res
.
end
(
"fail"
);
}
var
returnObj
=
{
"challenge"
:
result
.
data
,
// 应用需要原样返回的值
};
returnObj
=
JSON
.
stringify
(
returnObj
);
return
res
.
end
(
returnObj
);
}
catch
(
error
)
{
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"飞书小程序记录回调处理结果异常:,method=subscribeVerification"
,
op
:
"app/config/routes/api.js/feishu/subscribeVerification"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
});
}
});
//飞书通知
app
.
use
(
'/feishu/notify'
,
async
function
(
req
,
res
)
{
try
{
...
...
center-channel/app/front/entry/public/apidoc/opTrademark/tmSearch.md
View file @
1d6f19de
...
...
@@ -2676,6 +2676,6 @@
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
null
,
"requestId"
:
"3b8c2108ec8743c0a138081c5223f91c"
}
```
```
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