提交 aa267fb6 编写于 作者: 雪洛's avatar 雪洛

fix: verify sign error

上级 d9820861
......@@ -8,10 +8,15 @@ const needSignFunctions = new Set([
module.exports = function () {
const methodName = this.getMethodName()
const { source } = this.getUniversalClientInfo()
// 非 HTTP 方式请求不需要鉴权
if (source !== 'http') return
// 指定接口需要鉴权
if (!needSignFunctions.has(methodName)) return
// 非 HTTP 方式请求不需要鉴权
if (source !== 'http') {
throw {
errCode: ERROR.ILLEGAL_REQUEST
}
}
const timeout = 20 * 1000 // 请求超过20秒不能再请求,防止重放攻击
const { headers, body: _body } = this.getHttpInfo()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册