ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 解決中 / 官方已回 別人調用我寫的接口有點問題和獲取不到響應為空 3 0
guan1994 免費用戶 2020-06-19 16:23:46 私信
迅睿CMS版本:咨詢
別人調用我寫的接口,有點問題 header和body 獲取不到 響應為空
解決方案
  • 2020-06-19 16:30:43
    Chrome 6分鐘57秒 0

    @Before(YgwAuthInterceptor.class)

    @ControllerMapping(value = "/ws/rebate", viewdir = "/")

    public class UseRebateController extends YgwController{

    UseRebateService useRebateService = new UseRebateService();

    /**

    *

    */

    public void deductRebate() {

    PlatformRebateRequest request= (PlatformRebateRequest) getBody(PlatformRebateRequest.class);

    renderJson(useRebateService.deductRebate(request));

    }

    }

    2.YgwAuthInterceptor

    public class YgwAuthInterceptor implements Interceptor {

    @Override

    public void intercept(Invocation inv) {

    YgwController controller = (YgwController) inv.getController();

    Header header = controller.getHeader();

    if (header == null

    || StringUtils.isEmpty(header.getBusinessCode())

    || StringUtils.isEmpty(header.getSign())) {

    controller.renderText("{\"code\":\"403\", \"msg\":\"接口驗證失敗,驗證信息不能為空\"}");

    return;

    }

    // 時間戳最多只能用1個小時

    if (System.currentTimeMillis() - header.getTimestamp() > 3600000) {

    controller.renderText("{\"code\":\"403\", \"msg\":\"接口驗證失敗,時間戳超時\"}");

    return;

    }

    String body;

    try {

    body = EncryptUtils.desDecrypt(controller.getPara("body"), Constant.DESKEY);

    } catch (Exception e) {

    controller.renderText("{\"code\":\"403\", \"msg\":\"接口驗證失敗,Body解密失敗\"}");

    return;

    }

    String sign = header.getBusinessCode() + "|" + header.getTimestamp() + "|" + body + "|" + Constant.YGW_DESKEY;

    if (header.getSign().equals(EncryptUtils.encrypt(sign))) {

    inv.invoke();

    return;

    }

    controller.renderText("{\"code\":\"403\", \"msg\":\"接口驗證失敗,簽名錯誤\"}");

    }

    我用postman測試,返回這個{\"code\":\"403\", \"msg\":\"接口驗證失敗,驗證信息不能為空\"}

  • 看不懂這個,我們是xunruicms,你這些語法完全跟xunruicms不相關了