提交 7ba8f0f0 编写于 作者: C chenruilong

fix: 微信授权手机号登录没有邀请码字段

上级 8eb8a39a
...@@ -26,18 +26,22 @@ const { ...@@ -26,18 +26,22 @@ const {
* 微信授权手机号登录 * 微信授权手机号登录
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-mobile * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-mobile
* @param {Object} params * @param {Object} params
* @param {String} params.loginCode 微信登录返回的code
* @param {String} params.phoneCode 微信手机号返回的code * @param {String} params.phoneCode 微信手机号返回的code
* @param {String} params.inviteCode 邀请码
* @returns * @returns
*/ */
module.exports = async function (params = {}) { module.exports = async function (params = {}) {
const schema = { const schema = {
phoneCode: 'string' phoneCode: 'string',
inviteCode: {
type: 'string',
required: false
}
} }
this.middleware.validate(params, schema) this.middleware.validate(params, schema)
const { phoneCode } = params const { phoneCode, inviteCode } = params
const weixinApi = initWeixin.call(this) const weixinApi = initWeixin.call(this)
let mobile let mobile
...@@ -99,6 +103,7 @@ module.exports = async function (params = {}) { ...@@ -99,6 +103,7 @@ module.exports = async function (params = {}) {
...extraData ...extraData
}, },
isThirdParty: false, isThirdParty: false,
type type,
inviteCode
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册