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

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

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