收藏
回答

config:fail,Error: 错误码63002,invalid signature?

  String wechatTicket = getWechatTicket();
  int i = url.indexOf("#");
  if(-1!= i){
      url = url.substring(0,i);
  }
  String timeStamp = Long.toString(System.currentTimeMillis() / 1000);
  String nonceStr = RandomUtil.randomString(16);
  String signStr = "jsapi_ticket=" + wechatTicket +
          "&noncestr=" + nonceStr +
          "&timestamp=" + timeStamp +
          "&url=" + url;
  String sign = null;
  try {
      MessageDigest crypt = MessageDigest.getInstance("SHA-1");
      crypt.reset();
      crypt.update(signStr.getBytes("UTF-8"));
      sign = byteToHex(crypt.digest());
  } catch (NoSuchAlgorithmException e) {
      e.printStackTrace();
  } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
  }
签名代码

appId"xxxxxx"
nonceStr"wbj8l75kr0s69j4o"
sign"ed3a17824389c336f3f6a501ac9aedc4f88bfef0"
signStr"jsapi_ticket=kgt8ON7yVITDhtdwci0qeTlOub9XtTpCVcCr_e3nF7g-ibPnRe-_kQBA5CsDsXN8LZVp_bcF-UwT3wMhE3ZfRA&noncestr=wbj8l75kr0s69j4o&timestamp=1624590305&url=http://blindbox.brandpano.com/index.html?activityId=tmtgqlagxo1"
timestamp"1624590305"
wechatTicket"kgt8ON7yVITDhtdwci0qeTlOub9XtTpCVcCr_e3nF7g-ibPnRe-_kQBA5CsDsXN8LZVp_bcF-UwT3wMhE3ZfRA"
是我哪里有问题吗签名过不了?
回答关注问题邀请回答
收藏

1 个回答

  • ㅤSunkㅤCost
    ㅤSunkㅤCost
    2021-06-28

    补充票据这块也是jsapi

    所以怀疑是服务器设置问题

    但服务器配置访问文件没有问题

    而js安全域名配置上面也有贴图

    找不到问题点

    2021-06-28
    有用
    回复 2
    • ㅤSunkㅤCost
      ㅤSunkㅤCost
      2021-06-29
      let urlInfo = encodeURIComponent(window.location.href);  解决
      2021-06-29
      回复
    • Killua
      Killua
      2022-01-13回复ㅤSunkㅤCost
      你前端encode了,后端decode了吗?
      2022-01-13
      回复
登录 后发表内容
问题标签