Code Monkey home page Code Monkey logo

Comments (4)

Micjoyce avatar Micjoyce commented on June 11, 2024

在验证字符串的时候添加

if (!data) return
修改为
if (checker.type !== 'string' || !data) return

可以修复这个问题。

from alipay.

Luncher avatar Luncher commented on June 11, 2024

谢谢你的反馈,可能是当时文档没有看清楚。问题已经修复

from alipay.

Micjoyce avatar Micjoyce commented on June 11, 2024

还有一个小问题 utils.js 中的 verifySign在验证异步回调的时候不能验证通过。

export function verifySign(publicKey, response, omit, options) {
  const type = responseType(response)
  if (!type || !response.sign) {
    return false
  } else {
    // const sign = Base64.decode(response.sign)  // 这一句应该改为下面这一句,不然异步回掉的验证不能通过。
    const sign = response.sign // new
    const resp = makeSignStr(response[type], omit)
    const algorithm = signAlgorithm(options.sign_type)
    const verify = crypto.createVerify(algorithm)
    verify.update(resp, 'utf8')
    return verify.verify(publicKey, sign, 'base64')
  }
}

from alipay.

Luncher avatar Luncher commented on June 11, 2024

好的,你能把校验的参数一并贴一下吗?我明天试一试,谢谢!:)

from alipay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.