提交 21b2a433 编写于 作者: C chenruilong

feat: 华为元服务登录

上级 396d84c6
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
}, { }, {
"value": "huawei", "value": "huawei",
"text": "华为登录" "text": "华为登录"
}, {
"value": "huaweiMobile",
"text": "华为账号一键登录"
}] }]
} }
}, },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
mode="widthFix"></image> mode="widthFix"></image>
</view> </view>
<input @blur="focusCaptchaInput = false" :focus="focusCaptchaInput" type="text" class="captcha" <input @blur="focusCaptchaInput = false" :focus="focusCaptchaInput" type="text" class="captcha"
:inputBorder="false" maxlength="4" v-model="val" placeholder="请输入验证码"> :inputBorder="false" maxlength="4" v-model="val" placeholder="请输入验证码"></input>
</view> </view>
</template> </template>
......
## 1.1.23(2024-11-05) ## 1.1.24(2024-12-20)
- uni-id-co 修复 没有配置敏感信息解密密钥时导致登录报错的问题 - 新增 支持华为元服务登录
## 1.1.23(2024-11-05)
- uni-id-co 修复 没有配置敏感信息解密密钥时导致登录报错的问题
## 1.1.22(2024-09-13) ## 1.1.22(2024-09-13)
- 注册登录时去除字符串两端的空白字符 - 注册登录时去除字符串两端的空白字符
- 删除static目录下重复资源 - 删除static目录下重复资源
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
import config from '@/uni_modules/uni-id-pages/config.js' import config from '@/uni_modules/uni-id-pages/config.js'
let retryFun = ()=>console.log('为定义') let retryFun = ()=>console.log('为定义')
/** /**
* uni-id-pages-agreements * uni-id-pages-agreements
* @description 用户服务协议和隐私政策条款组件 * @description 用户服务协议和隐私政策条款组件
* @property {String,Boolean} scope = [register|login] 作用于哪种场景如:register 注册(包括登录并注册,如:微信登录、苹果登录、短信验证码登录)、login 登录。默认值为:register * @property {String,Boolean} scope = [register|login] 作用于哪种场景如:register 注册(包括登录并注册,如:微信登录、苹果登录、短信验证码登录)、login 登录。默认值为:register
*/ */
...@@ -74,12 +74,22 @@ ...@@ -74,12 +74,22 @@
popup(Fun){ popup(Fun){
this.needPopupAgreements = true this.needPopupAgreements = true
// this.needAgreements = true // this.needAgreements = true
//::TODO 鸿蒙元服务暂不支持 createAnimation,等支持后再打开
// #ifdef MP-HARMONY
return uni.showModal({
title: "提示",
content: `请先阅读并同意${this.agreements.map(item=>`“${item.title}”`).join('')}`,
})
// #endif
// #ifndef MP-HARMONY
this.$nextTick(()=>{ this.$nextTick(()=>{
if(Fun){ if(Fun){
retryFun = Fun retryFun = Fun
} }
this.$refs.popupAgreement.open() this.$refs.popupAgreement.open()
}) })
// #endif
}, },
navigateTo({ navigateTo({
url, url,
...@@ -100,7 +110,7 @@ ...@@ -100,7 +110,7 @@
this.$emit('setAgree', this.isAgree) this.$emit('setAgree', this.isAgree)
} }
}, },
created() { created() {
this.needAgreements = (config?.agreements?.scope || []).includes(this.scope) this.needAgreements = (config?.agreements?.scope || []).includes(this.scope)
}, },
data() { data() {
...@@ -145,7 +155,7 @@ ...@@ -145,7 +155,7 @@
color: #04498c; color: #04498c;
cursor: pointer; cursor: pointer;
} }
.checkbox-box ::v-deep .uni-checkbox-input{ .checkbox-box ::v-deep .uni-checkbox-input{
border-radius: 100%; border-radius: 100%;
} }
...@@ -155,13 +165,13 @@ ...@@ -155,13 +165,13 @@
color: #FFFFFF !important; color: #FFFFFF !important;
background-color: $uni-color-primary; background-color: $uni-color-primary;
} }
.content{ .content{
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;
} }
.root ::v-deep .uni-popup__error{ .root ::v-deep .uni-popup__error{
color: #333333; color: #333333;
} }
</style> </style>
...@@ -62,22 +62,29 @@ ...@@ -62,22 +62,29 @@
"text": "微信登录", "text": "微信登录",
"logo": "/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png", "logo": "/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png",
}, },
{
"id": "huawei",
"text": "华为登录",
"logo": "/uni_modules/uni-id-pages/static/login/uni-fab-login/huawei.png",
"path": "/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=huawei"
},
{
"id": "huaweiMobile",
"text": "华为账号一键登录",
"logo": "/uni_modules/uni-id-pages/static/login/uni-fab-login/huawei.png",
"path": "/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=huaweiMobile"
},
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN
{ {
"id": "apple", "id": "apple",
"text": "苹果登录", "text": "苹果登录",
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/apple.png", "logo": "/uni_modules/uni-id-pages/static/uni-fab-login/apple.png",
}, },
{ {
"id": "univerify", "id": "univerify",
"text": "一键登录", "text": "一键登录",
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/univerify.png", "logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/univerify.png",
}, },
{
"id": "huawei",
"text": "华为登录",
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/univerify.png",
},
{ {
"id": "taobao", "id": "taobao",
"text": "淘宝登录", //暂未提供该登录方式的接口示例 "text": "淘宝登录", //暂未提供该登录方式的接口示例
...@@ -207,7 +214,7 @@ ...@@ -207,7 +214,7 @@
return '/' + pages[pages.length - n].route return '/' + pages[pages.length - n].route
}, },
toPage(path,index = 0) { toPage(path,index = 0) {
//console.log('比较', this.getRoute(1),this.getRoute(2), path) console.log('比较', this.getRoute(1),this.getRoute(2), path)
if (this.getRoute(1) == path.split('?')[0] && this.getRoute(1) == if (this.getRoute(1) == path.split('?')[0] && this.getRoute(1) ==
'/uni_modules/uni-id-pages/pages/login/login-withoutpwd') { '/uni_modules/uni-id-pages/pages/login/login-withoutpwd') {
//如果要被打开的页面已经打开,且这个页面是 /uni_modules/uni-id-pages/pages/index/index 则把类型参数传给他 //如果要被打开的页面已经打开,且这个页面是 /uni_modules/uni-id-pages/pages/index/index 则把类型参数传给他
...@@ -238,7 +245,7 @@ ...@@ -238,7 +245,7 @@
} }
}, },
async login_before(type, navigateBack = true, options = {}) { async login_before(type, navigateBack = true, options = {}) {
console.log(type); console.log(type, options);
//提示空实现 //提示空实现
if (["qq", if (["qq",
"xiaomi", "xiaomi",
...@@ -256,15 +263,17 @@ ...@@ -256,15 +263,17 @@
}); });
} }
console.log('检查当前环境是否支持这种登录方式')
//检查当前环境是否支持这种登录方式 //检查当前环境是否支持这种登录方式
// #ifdef APP // #ifdef APP
let isAppExist = true let isAppExist = true
await new Promise((callback) => { await new Promise((callback) => {
console.log('uni.getProvider', uni.getProvider)
uni.getProvider({ uni.getProvider({
service: 'oauth', service: 'oauth',
success: (res) => { success: (res) => {
const provider = res.providers.find(item => item.id === type) const provider = res.providers.find(item => item.id === type)
console.log('res', res)
if (provider) { if (provider) {
isAppExist = provider?.isAppExist ?? true isAppExist = provider?.isAppExist ?? true
callback() callback()
...@@ -282,6 +291,7 @@ ...@@ -282,6 +291,7 @@
}) })
}) })
// #endif // #endif
if ( if (
// #ifdef APP // #ifdef APP
!isAppExist !isAppExist
...@@ -347,7 +357,11 @@ ...@@ -347,7 +357,11 @@
} }
} }
// #endif // #endif
console.log('login ----')
uni.showLoading({ uni.showLoading({
// #ifdef MP-HARMONY
title: "正在登录",
// #endif
mask: true mask: true
}) })
...@@ -425,7 +439,7 @@ ...@@ -425,7 +439,7 @@
}) })
} }
if (type === 'weixinMobile') { if (type === 'weixinMobile' || type === 'huaweiMobile') {
return this.login({ return this.login({
phoneCode: options.phoneNumberCode phoneCode: options.phoneNumberCode
}, type) }, type)
...@@ -451,7 +465,12 @@ ...@@ -451,7 +465,12 @@
} : e.authResult, type) } : e.authResult, type)
}, },
fail: async (err) => { fail: async (err) => {
console.log(JSON.stringify(err)); console.error(JSON.stringify(err));
uni.showModal({
content: `登录失败; code: ${err.errCode || -1}`,
confirmText: "知道了",
showCancel: false
});
uni.hideLoading() uni.hideLoading()
} }
}) })
...@@ -570,6 +589,6 @@ ...@@ -570,6 +589,6 @@
margin-top: 6px; margin-top: 6px;
color: #999; color: #999;
font-size: 10px; font-size: 10px;
width: 70px; width: 80px;
} }
</style> </style>
...@@ -19,12 +19,18 @@ export default { ...@@ -19,12 +19,18 @@ export default {
// #ifdef APP // #ifdef APP
'univerify', 'univerify',
// #endif // #endif
// #ifndef MP-HARMONY
'weixin', 'weixin',
// #endif
'username', 'username',
// #ifdef APP // #ifdef APP
'apple', 'apple',
// #endif // #endif
'smsCode' 'smsCode',
// #ifdef APP-HARMONY || MP-HARMONY
'huawei',
'huaweiMobile'
// #endif
], ],
// 政策协议 // 政策协议
agreements: { agreements: {
......
{ {
"id": "uni-id-pages", "id": "uni-id-pages",
"displayName": "uni-id-pages", "displayName": "uni-id-pages",
"version": "1.1.23", "version": "1.1.24",
"description": "云端一体简单、统一、可扩展的用户中心页面模版", "description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [ "keywords": [
"用户管理", "用户管理",
......
...@@ -7,13 +7,20 @@ ...@@ -7,13 +7,20 @@
<!-- 顶部文字 --> <!-- 顶部文字 -->
<text class="title">请选择登录方式</text> <text class="title">请选择登录方式</text>
<!-- 快捷登录框 当url带参数时有效 --> <!-- 快捷登录框 当url带参数时有效 -->
<template v-if="['apple','weixin', 'weixinMobile', 'huawei'].includes(type)"> <template v-if="['apple','weixin', 'weixinMobile', 'huawei', 'huaweiMobile'].includes(type)">
<text class="tip">将根据第三方账号服务平台的授权范围获取你的信息</text> <text class="tip">将根据第三方账号服务平台的授权范围获取你的信息</text>
<view class="quickLogin"> <view class="quickLogin">
<image v-if="type !== 'weixinMobile'" @click="quickLogin" :src="imgSrc" mode="widthFix" <image v-if="type !== 'weixinMobile' && type !== 'huaweiMobile'" @click="quickLogin" :src="imgSrc" mode="widthFix"
class="quickLoginBtn"></image> class="quickLoginBtn"></image>
<button v-else type="primary" open-type="getPhoneNumber" @getphonenumber="quickLogin" <view v-else style="position: relative">
class="uni-btn">微信授权手机号登录</button> <button v-if="type ==='weixinMobile'" type="primary" open-type="getPhoneNumber" @getphonenumber="quickLogin"
class="uni-btn">微信授权手机号登录</button>
<button v-if="type === 'huaweiMobile'" open-type="getPhoneNumber" @getphonenumber="quickLogin"
class="quickLoginBtn" style="padding: 0; display: flex">
<image :src="imgSrc" mode="widthFix"></image>
</button>
<view v-if="this.needAgreements && !this.agree" class="mobile-login-agreement-layer" @click="showAgreementModal"></view>
</view>
<uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements> <uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements>
</view> </view>
</template> </template>
...@@ -57,7 +64,8 @@ ...@@ -57,7 +64,8 @@
const images = { const images = {
weixin: '/uni_modules/uni-id-pages/static/login/weixin.png', weixin: '/uni_modules/uni-id-pages/static/login/weixin.png',
apple: '/uni_modules/uni-id-pages/static/app/apple.png', apple: '/uni_modules/uni-id-pages/static/app/apple.png',
huawei: '/uni_modules/uni-id-pages/static/app/huawei.png' huawei: '/uni_modules/uni-id-pages/static/login/huawei.png',
huaweiMobile: '/uni_modules/uni-id-pages/static/login/huawei-mobile.png',
} }
return images[this.type] return images[this.type]
} }
...@@ -73,7 +81,7 @@ ...@@ -73,7 +81,7 @@
} }
this.$nextTick(() => { this.$nextTick(() => {
//关闭重复显示的登录快捷方式 //关闭重复显示的登录快捷方式
if (['weixin', 'apple'].includes(type)) { if (['weixin', 'apple', 'huawei', 'huaweiMobile'].includes(type)) {
this.$refs.uniFabLogin.servicesList = this.$refs.uniFabLogin.servicesList.filter(item => this.$refs.uniFabLogin.servicesList = this.$refs.uniFabLogin.servicesList.filter(item =>
item.id != type) item.id != type)
} }
...@@ -133,14 +141,17 @@ ...@@ -133,14 +141,17 @@
"top": 0 "top": 0
}) })
}, },
showAgreementModal () {
this.$refs.agreements.popup()
},
quickLogin(e) { quickLogin(e) {
let options = {} let options = {}
console.log(e)
if (e.detail?.code) { if (e.detail?.code) {
options.phoneNumberCode = e.detail.code options.phoneNumberCode = e.detail.code
} }
if (this.type === 'weixinMobile' && !e.detail?.code) return if ((this.type === 'weixinMobile' || this.type === 'huaweiMobile') && !e.detail?.code) return
this.$refs.uniFabLogin.login_before(this.type, true, options) this.$refs.uniFabLogin.login_before(this.type, true, options)
}, },
...@@ -187,6 +198,13 @@ ...@@ -187,6 +198,13 @@
} }
} }
.mobile-login-agreement-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.uni-content, .uni-content,
.quickLogin { .quickLogin {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -242,6 +260,9 @@ ...@@ -242,6 +260,9 @@
.quickLoginBtn { .quickLoginBtn {
margin: 20px 0; margin: 20px 0;
width: 450rpx; width: 450rpx;
background-color: transparent;
border: none;
box-shadow: none;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
max-width: 230px; max-width: 230px;
/* #endif */ /* #endif */
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
:inputBorder="false" v-model="username" placeholder="请输入手机号/用户名/邮箱" trim="all" /> :inputBorder="false" v-model="username" placeholder="请输入手机号/用户名/邮箱" trim="all" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item name="password"> <uni-forms-item name="password">
<uni-easyinput :focus="focusPassword" @blur="focusPassword = false" class="input-box" clearable <uni-easyinput :focus="focusPassword" @blur="focusPassword = false" class="input-box" clearable
type="password" :inputBorder="false" v-model="password" placeholder="请输入密码" trim="all" /> type="password" :inputBorder="false" v-model="password" placeholder="请输入密码" trim="all" />
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<uni-captcha v-if="needCaptcha" focus ref="captcha" scene="login-by-pwd" v-model="captcha" /> <uni-captcha v-if="needCaptcha" focus ref="captcha" scene="login-by-pwd" v-model="captcha" />
......
...@@ -34,7 +34,8 @@ const { ...@@ -34,7 +34,8 @@ const {
loginByQQ, loginByQQ,
loginByApple, loginByApple,
loginByWeixinMobile, loginByWeixinMobile,
loginByHuawei loginByHuawei,
loginByHuaweiMobile
} = require('./module/login/index') } = require('./module/login/index')
const { const {
logout logout
...@@ -50,7 +51,10 @@ const { ...@@ -50,7 +51,10 @@ const {
unbindWeixin, unbindWeixin,
unbindAlipay, unbindAlipay,
unbindQQ, unbindQQ,
unbindApple unbindApple,
bindHuawei,
unbindHuawei,
bindMobileByHuawei
} = require('./module/relate/index') } = require('./module/relate/index')
const { const {
setPwd, setPwd,
...@@ -419,6 +423,7 @@ module.exports = { ...@@ -419,6 +423,7 @@ module.exports = {
loginByApple, loginByApple,
loginByWeixinMobile, loginByWeixinMobile,
loginByHuawei, loginByHuawei,
loginByHuaweiMobile,
/** /**
* 用户退出登录 * 用户退出登录
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#logout * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#logout
...@@ -694,5 +699,8 @@ module.exports = { ...@@ -694,5 +699,8 @@ module.exports = {
* @param {Boolean} params.decryptData 是否解密数据 * @param {Boolean} params.decryptData 是否解密数据
* @returns * @returns
*/ */
getRealNameInfo getRealNameInfo,
bindHuawei,
unbindHuawei,
bindMobileByHuawei
} }
function getHuaweiPlatform () {
const platform = this.clientPlatform
switch (platform) {
case 'app':
case 'app-harmony':
return 'app-harmony'
case 'mp-harmony':
return 'mp-harmony'
default:
throw new Error('Unsupported weixin platform')
}
}
module.exports = {
getHuaweiPlatform
}
...@@ -17,5 +17,6 @@ module.exports = { ...@@ -17,5 +17,6 @@ module.exports = {
loginByFacebook: require('./login-by-facebook'), loginByFacebook: require('./login-by-facebook'),
loginByGoogle: require('./login-by-google'), loginByGoogle: require('./login-by-google'),
loginByWeixinMobile: require('./login-by-weixin-mobile'), loginByWeixinMobile: require('./login-by-weixin-mobile'),
loginByHuawei: require('./login-by-huawei') loginByHuawei: require('./login-by-huawei'),
loginByHuaweiMobile: require('./login-by-huawei')
} }
...@@ -9,10 +9,8 @@ const { ...@@ -9,10 +9,8 @@ const {
postUnifiedLogin postUnifiedLogin
} = require('../../lib/utils/unified-login') } = require('../../lib/utils/unified-login')
const { const {
generateWeixinCache, getHuaweiPlatform,
getWeixinPlatform, } = require('../../lib/utils/huawei')
saveWeixinUserKey,
} = require('../../lib/utils/weixin')
const { const {
LOG_TYPE LOG_TYPE
} = require('../../common/constants') } = require('../../common/constants')
...@@ -21,33 +19,59 @@ const {initHuawei} = require("../../lib/third-party"); ...@@ -21,33 +19,59 @@ const {initHuawei} = require("../../lib/third-party");
/** /**
* 华为登录 * 华为登录
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-huawei
* @param {Object} params * @param {Object} params
* @param {String} params.code 微信登录返回的code * @param {String} params.code 华为登录返回的code
* @param {String} params.inviteCode 邀请码 * @param {String} params.inviteCode 邀请码
* @returns * @returns
*/ */
module.exports = async function (params = {}) { module.exports = async function (params = {}) {
const schema = { const schema = {
code: 'string', code: {
type: 'string',
required: false
},
phoneCode: {
type: 'string',
required: false
},
inviteCode: { inviteCode: {
type: 'string', type: 'string',
required: false required: false
} }
} }
this.middleware.validate(params, schema) this.middleware.validate(params, schema)
const { const {
code,
inviteCode inviteCode
} = params } = params
if (!params.code && !params.phoneCode) {
throw {
errCode: ERROR.PARAM_REQUIRED,
errMsgValue: {
param: 'code or phoneCode'
}
}
}
const {
appId
} = this.getUniversalClientInfo()
const huaweiPlatform = getHuaweiPlatform.call(this)
const code = params.code || params.phoneCode
const huaweiApi = initHuawei.call(this) const huaweiApi = initHuawei.call(this)
let accountResult let accessToken
try { try {
const {accessToken} = await huaweiApi.getUserAccessToken(code) const res = await huaweiApi.getUserAccessToken(code)
accountResult = await huaweiApi.getAccessTokenInfo(accessToken)
accountResult.accessToken = accessToken if (res.errCode !== 0) {
console.error(res)
throw new Error(res.errMsg)
}
accessToken = res.accessToken
} catch (error) { } catch (error) {
console.error(error) console.error(error)
await this.middleware.uniIdLog({ await this.middleware.uniIdLog({
...@@ -60,33 +84,39 @@ module.exports = async function (params = {}) { ...@@ -60,33 +84,39 @@ module.exports = async function (params = {}) {
} }
const { const {
openId, openID: openId,
unionId, unionID: unionId,
accessToken purePhoneNumber: mobile,
} = accountResult displayName: nickname,
headPictureURL: avatar,
} = await huaweiApi.getUserInfo(accessToken)
const { const {
type, type,
user user
} = await preUnifiedLogin.call(this, { } = await preUnifiedLogin.call(this, {
user: { user: {
huawei_openid: openId, huawei_openid: {
huawei_unionid: unionId [huaweiPlatform]: openId
},
huawei_unionid: unionId,
mobile
} }
}) })
const extraData = { const extraData = {
huawei_openid: openId, huawei_openid: {
[`${huaweiPlatform}_${appId}`]: openId
},
huawei_unionid: unionId huawei_unionid: unionId
} }
if (mobile) {
extraData.mobile = mobile
extraData.mobile_confirmed = 1
}
if (type === 'register') { if (type === 'register') {
const res = await huaweiApi.getUserInfo(accessToken)
console.log('userinfo', res)
const {
displayName: nickname,
headPictureURL: avatar
} = res
if (avatar) { if (avatar) {
// eslint-disable-next-line n/no-deprecated-api // eslint-disable-next-line n/no-deprecated-api
const avatarPath = url.parse(avatar).pathname const avatarPath = url.parse(avatar).pathname
...@@ -112,7 +142,6 @@ module.exports = async function (params = {}) { ...@@ -112,7 +142,6 @@ module.exports = async function (params = {}) {
url: fileID url: fileID
} }
} }
extraData.nickname = nickname extraData.nickname = nickname
} }
......
const {
preBind,
postBind
} = require('../../lib/utils/relate')
const {
LOG_TYPE
} = require('../../common/constants')
const {
decryptWeixinData,
getWeixinCache, getWeixinAccessToken
} = require('../../lib/utils/weixin')
const {initWeixin} = require('../../lib/third-party')
const {ERROR} = require('../../common/error')
const {initHuawei} = require("../../lib/third-party");
/**
* 通过华为账号一键登录绑定手机号
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-huawei
* @param {Object} params
* @param {String} params.code 华为账号一键登录获取手机号返回的code
* @returns
*/
module.exports = async function (params = {}) {
const schema = {
code: "string"
}
const {
code
} = params
this.middleware.validate(params, schema)
const huaweiApi = initHuawei.call(this)
const uid = this.authInfo.uid
const {accessToken} = await huaweiApi.getUserAccessToken(code)
const res = await huaweiApi.getUserInfo(accessToken)
const mobile = res.purePhoneNumber
const bindAccount = {
mobile
}
await preBind.call(this, {
uid,
bindAccount,
logType: LOG_TYPE.BIND_MOBILE
})
await postBind.call(this, {
uid,
bindAccount,
extraData: {
mobile_confirmed: 1
},
logType: LOG_TYPE.BIND_MOBILE
})
return {
errCode: 0
}
}
...@@ -9,5 +9,8 @@ module.exports = { ...@@ -9,5 +9,8 @@ module.exports = {
unbindWeixin: require('./unbind-weixin'), unbindWeixin: require('./unbind-weixin'),
unbindAlipay: require('./unbind-alipay'), unbindAlipay: require('./unbind-alipay'),
unbindQQ: require('./unbind-qq'), unbindQQ: require('./unbind-qq'),
unbindApple: require('./unbind-apple') unbindApple: require('./unbind-apple'),
bindHuawei: require('./bind-huawei'),
unbindHuawei: require('./unbind-huawei'),
bindMobileByHuawei: require('./bind-mobile-by-huawei'),
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</view> </view>
<view v-else class="uni-dialog-content"> <view v-else class="uni-dialog-content">
<slot> <slot>
<input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" > <input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus"></input>
</slot> </slot>
</view> </view>
<view class="uni-dialog-button-group"> <view class="uni-dialog-button-group">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册