use of com.github.liuweijw.commons.base.R in project fw-cloud-framework by liuweijw.
the class WxAuthorizeController method refreshToken.
@RequestMapping(value = "/refreshToken", method = RequestMethod.GET)
public R<WxMpOAuth2AccessToken> refreshToken(HttpServletRequest request, @RequestParam("refreshToken") String refreshToken) {
if (StringHelper.isBlank(refreshToken))
return new R<WxMpOAuth2AccessToken>().failure("请求参数[refreshToken]不存在!");
log.info("【wxauth】:refreshToken|" + refreshToken);
WxMpOAuth2AccessToken wxMpOAuth2AccessToken;
try {
wxMpOAuth2AccessToken = wxService.oauth2refreshAccessToken(refreshToken);
return new R<WxMpOAuth2AccessToken>().data(wxMpOAuth2AccessToken).success();
} catch (WxErrorException e) {
e.printStackTrace();
}
return new R<WxMpOAuth2AccessToken>().failure("微信refreshToken刷新失败!");
}
Aggregations