提交 2ed61d4d 编写于 作者: C chenruilong

fix(uni-id-co): URL化时第三方登录无法获取 uniPlatform 参数

上级 2b4ff012
......@@ -191,6 +191,100 @@ const testCaseList = [{
expected: {
errCode: ERROR.PARAM_REQUIRED
}
}, {
value: {
mobile: '18811112222'
},
schema: {
mobile: 'mobile'
}
}, {
value: {
mobile: '18811112222'
},
schema: {
mobile: {
required: false,
type: 'mobile'
}
}
}, {
value: {
mobile: ''
},
schema: {
mobile: 'mobile'
},
expected: {
errCode: ERROR.PARAM_REQUIRED
}
}, {
value: {
mobile: ''
},
schema: {
mobile: {
required: false,
type: 'mobile'
}
}
}, {
value: {
mobile: '123456'
},
schema: {
mobile: 'mobile'
},
expected: {
errCode: ERROR.INVALID_MOBILE
}
}, {
value: {
email: 'test@dcloud.io'
},
schema: {
email: 'email'
}
}, {
value: {
email: 'test@dcloud.io'
},
schema: {
email: {
required: false,
type: 'email'
}
}
}, {
value: {
email: ''
},
schema: {
email: 'email'
},
expected: {
errCode: ERROR.PARAM_REQUIRED
}
}, {
value: {
email: ''
},
schema: {
email: {
required: false,
type: 'email'
}
}
}, {
value: {
email: 'test'
},
schema: {
email: 'email'
},
expected: {
errCode: ERROR.INVALID_EMAIL
}
}]
function execTestCase ({
......@@ -209,7 +303,7 @@ function execTestCase ({
validator.mixin(type, handler)
}
let validateResult,
validateError
validateError
try {
validateResult = validator.validate(value, schema)
} catch (err) {
......
......@@ -22,7 +22,7 @@ class ConfigUtils {
context
} = {}) {
this.context = context
this.clientInfo = context.getClientInfo()
this.clientInfo = context.getUniversalClientInfo()
const {
appId,
uniPlatform
......
......@@ -7,7 +7,7 @@ const needSignFunctions = new Set([
module.exports = function () {
const methodName = this.getMethodName()
const { source } = this.getClientInfo()
const { source } = this.getUniversalClientInfo()
// 非 HTTP 方式请求不需要鉴权
if (source !== 'http') return
// 指定接口需要鉴权
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册