| | |
| | | import com.yeshi.buwan.pptv.PPTVUtil; |
| | | import com.yeshi.buwan.util.AESUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.log.LoggerUtil; |
| | | import org.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | @ResponseBody |
| | | @RequestMapping("user/{code}") |
| | | public void validCode(@PathVariable String code, HttpServletResponse response) throws IOException { |
| | | LoggerUtil.getTestLogger().info("PPTVCode回调:{}", code); |
| | | response.setContentType("application/json;charset=UTF-8"); |
| | | PPTVUtil.PPTVCodeInfo codeInfo = PPTVUtil.decryptPPTVCode(code); |
| | | if (codeInfo == null) { |
| | | LoggerUtil.getTestLogger().info("PPTVCode回调-解码失败:{}", code); |
| | | response.getWriter().print(loadFalseResult(1, "code校验失败,解码失败")); |
| | | } else { |
| | | //间隔时间大于1天 |
| | |
| | | response.getWriter().print(loadFalseResult(2, "code校验失败,时间超限")); |
| | | return; |
| | | } |
| | | LoggerUtil.getTestLogger().info("PPTVCode回调-解码成功:{},{}", code, codeInfo.pptvUid); |
| | | |
| | | response.getWriter().print(loadTrueResult(codeInfo.pptvUid)); |
| | | } |
| | | } |