优化代码
This commit is contained in:
@@ -50,7 +50,7 @@ public class WeixinTicketCreator extends AbstractTokenCreator {
|
||||
@Override
|
||||
public Token createToken() throws WeixinException {
|
||||
WeixinResponse response = weixinExecutor.get(
|
||||
String.format(URLConsts.TICKET_URL, weixinTokenHolder.getToken().getAccessToken(), ticketType.name()));
|
||||
String.format(URLConsts.JS_TICKET_URL, weixinTokenHolder.getToken().getAccessToken(), ticketType.name()));
|
||||
JSONObject result = response.getAsJson();
|
||||
Token token = new Token(result.getString("ticket"));
|
||||
token.setExpiresIn(result.getIntValue("expires_in"));
|
||||
|
||||
@@ -19,6 +19,6 @@ public final class URLConsts {
|
||||
/**
|
||||
* 公众平台jssdk获取token的url
|
||||
*/
|
||||
public static final String TICKET_URL = BASE_URL
|
||||
public static final String JS_TICKET_URL = BASE_URL
|
||||
+ "/ticket/getticket?access_token=%s&type=%s";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user