Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 111a3877
authored
Jan 31, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
d747ed31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTicketController.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeTicketClient.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTicketController.java
View file @
111a387
...
...
@@ -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
View file @
111a387
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
);
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment