admin
2021-04-03 32d6c2ea8039b4771fd6b1ded8b022733e32352f
src/main/java/com/yeshi/buwan/controller/PPTVController.java
@@ -4,6 +4,7 @@
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;
@@ -21,9 +22,11 @@
    @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天
@@ -31,6 +34,8 @@
                response.getWriter().print(loadFalseResult(2, "code校验失败,时间超限"));
                return;
            }
            LoggerUtil.getTestLogger().info("PPTVCode回调-解码成功:{},{}", code, codeInfo.pptvUid);
            response.getWriter().print(loadTrueResult(codeInfo.pptvUid));
        }
    }