admin
2021-03-13 7becc97c5bfdd827b9a999c26746bb8e8bc3e25c
src/main/java/com/yeshi/buwan/pptv/PPTVApiUtil.java
@@ -4,6 +4,7 @@
import com.yeshi.buwan.pptv.entity.PPTVSeries;
import com.yeshi.buwan.util.StringUtil;
import com.yeshi.buwan.util.TimeUtil;
import com.yeshi.buwan.util.log.LoggerUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.httpclient.HttpClient;
@@ -161,7 +162,7 @@
        Map<String, String> params = new HashMap<>();
        params.put("uid", uid);
//        String result = baseRequest("https://coapi.pptv.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get");
        String result = baseRequest("http://coapiwebsit.cnsuning.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get");
        String result = baseRequest("https://coapi.pptv.com/coapi-web/api/http/sopRequest", params, "pptv.channel.openid.get");
        System.out.println(result);
        JSONObject resultJSON = JSONObject.fromObject(result);
        JSONObject response = resultJSON.optJSONObject("response");
@@ -184,7 +185,7 @@
     * @param code
     */
    public static boolean login(String code) {
        String url = String.format("https://coapi.pptv.com/coapi-web/api/getUserToken/%s/%s.htm", APP_KEY, code);
        String url = String.format("https://coapi.pptv.com/coapi-web/api/getUserToken/%s/%s.htm", APP_KEY,URLEncoder.encode(code));
        String result = HttpUtil.get(url);
        System.out.println(result);
        JSONObject resultJSON = JSONObject.fromObject(result);
@@ -211,6 +212,7 @@
        params.put("orderTime", TimeUtil.getGernalTime(orderTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
        params.put("sign", StringUtil.Md5(String.format("%s&%s&%s&%s", openId, params.get("channel"), orderNo, "2MnD8nCWu7EzbiJ")));
        String result = get("http://billing.api.pptv.com/cusp/jointMember", params);
        LoggerUtil.getVIPLogger().info("开通会员-订单号:{},结果:{}", orderNo, result);
        System.out.println(result);
        JSONObject data = JSONObject.fromObject(result);
        if (data.optInt("errorCode") == 0) {