Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
仟微科技
Link Wechat
提交
52386630
Link Wechat
项目概览
仟微科技
/
Link Wechat
通知
48
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Link Wechat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
52386630
编写于
1月 31, 2021
作者:
孙
孙喜旺
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
c5db68f8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
6 deletion
+7
-6
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTicketController.java
...m/linkwechat/web/controller/wecom/WeTicketController.java
+4
-4
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeTicketClient.java
...main/java/com/linkwechat/wecom/client/WeTicketClient.java
+3
-2
未找到文件。
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTicketController.java
浏览文件 @
52386630
...
...
@@ -41,10 +41,10 @@ public class WeTicketController extends BaseController {
*/
@Log
(
title
=
"获取企业的jsapi_ticket"
,
businessType
=
BusinessType
.
OTHER
)
@GetMapping
(
"/getAppTicket"
)
public
AjaxResult
getAppTicket
(
String
url
)
{
public
AjaxResult
getAppTicket
(
String
url
,
String
agentId
)
{
String
ticketVaule
=
redisCache
.
getCacheObject
(
WeConstans
.
AppTicketKey
);
if
(
StringUtils
.
isEmpty
(
ticketVaule
))
{
WeH5TicketDto
ticketRes
=
weTicketClient
.
getJsapiTicket
();
WeH5TicketDto
ticketRes
=
weTicketClient
.
getJsapiTicket
(
agentId
);
if
(
ticketRes
!=
null
&&
StringUtils
.
isNotEmpty
(
ticketRes
.
getTicket
()))
{
redisCache
.
setCacheObject
(
WeConstans
.
AppTicketKey
,
ticketRes
.
getTicket
(),
ticketRes
.
getExpiresIn
(),
TimeUnit
.
SECONDS
);
}
...
...
@@ -61,10 +61,10 @@ public class WeTicketController extends BaseController {
*/
@Log
(
title
=
"获取应用的jsapi_ticket"
,
businessType
=
BusinessType
.
OTHER
)
@GetMapping
(
"/getAgentTicket"
)
public
AjaxResult
getAgentTicket
(
String
url
)
{
public
AjaxResult
getAgentTicket
(
String
url
,
String
agentId
)
{
String
ticketVaule
=
redisCache
.
getCacheObject
(
WeConstans
.
AgentTicketKey
);
if
(
StringUtils
.
isEmpty
(
ticketVaule
))
{
WeH5TicketDto
ticketRes
=
weTicketClient
.
getTicket
();
WeH5TicketDto
ticketRes
=
weTicketClient
.
getTicket
(
agentId
);
if
(
ticketRes
!=
null
&&
StringUtils
.
isNotEmpty
(
ticketRes
.
getTicket
()))
{
redisCache
.
setCacheObject
(
WeConstans
.
AgentTicketKey
,
ticketRes
.
getTicket
(),
ticketRes
.
getExpiresIn
(),
TimeUnit
.
SECONDS
);
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeTicketClient.java
浏览文件 @
52386630
package
com.linkwechat.wecom.client
;
import
com.dtflys.forest.annotation.Header
;
import
com.dtflys.forest.annotation.Request
;
import
com.linkwechat.wecom.domain.WeH5TicketDto
;
...
...
@@ -15,7 +16,7 @@ public interface WeTicketClient {
* @return
*/
@Request
(
url
=
"/get_jsapi_ticket"
)
WeH5TicketDto
getJsapiTicket
();
WeH5TicketDto
getJsapiTicket
(
@Header
(
"agentId"
)
String
agentId
);
/**
* 获取应用jsapi_ticket
...
...
@@ -23,5 +24,5 @@ public interface WeTicketClient {
* @return
*/
@Request
(
url
=
"/ticket/get"
)
WeH5TicketDto
getTicket
();
WeH5TicketDto
getTicket
(
@Header
(
"agentId"
)
String
agentId
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录