diff --git a/pages/index/index.vue b/pages/index/index.vue
index 775863b6bbb9d30402b4e4d5edbbb05bc723ce9e..8cda38eed318bbd27e873109166e3eb9dc3a97b1 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -34,6 +34,9 @@
}, {
"value": "huawei",
"text": "华为登录"
+ }, {
+ "value": "huaweiMobile",
+ "text": "华为账号一键登录"
}]
}
},
diff --git a/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue b/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue
index 1399e194a45674592053324125713068ee8719e6..71ca03058dba133cfc1a2cf303ca625b3e41d60b 100644
--- a/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue
+++ b/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue
@@ -6,7 +6,7 @@
mode="widthFix">
+ :inputBorder="false" maxlength="4" v-model="val" placeholder="请输入验证码">
diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md
index 1294ce2265446f7765937bb0c713107c309b3489..0096606a9d302589a2511944e70792ea12d2151d 100644
--- a/uni_modules/uni-id-pages/changelog.md
+++ b/uni_modules/uni-id-pages/changelog.md
@@ -1,5 +1,7 @@
-## 1.1.23(2024-11-05)
-- uni-id-co 修复 没有配置敏感信息解密密钥时导致登录报错的问题
+## 1.1.24(2024-12-20)
+- 新增 支持华为元服务登录
+## 1.1.23(2024-11-05)
+- uni-id-co 修复 没有配置敏感信息解密密钥时导致登录报错的问题
## 1.1.22(2024-09-13)
- 注册登录时去除字符串两端的空白字符
- 删除static目录下重复资源
diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue b/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue
index 861e3887e275f542c85201a5cb8a2d97bc0af4aa..b38bcd65df3ad8dd4d3cfcb08ab251abf50af6b2 100644
--- a/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue
+++ b/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue
@@ -33,7 +33,7 @@
import config from '@/uni_modules/uni-id-pages/config.js'
let retryFun = ()=>console.log('为定义')
/**
- * uni-id-pages-agreements
+ * uni-id-pages-agreements
* @description 用户服务协议和隐私政策条款组件
* @property {String,Boolean} scope = [register|login] 作用于哪种场景如:register 注册(包括登录并注册,如:微信登录、苹果登录、短信验证码登录)、login 登录。默认值为:register
*/
@@ -74,12 +74,22 @@
popup(Fun){
this.needPopupAgreements = 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(()=>{
if(Fun){
retryFun = Fun
}
this.$refs.popupAgreement.open()
})
+ // #endif
},
navigateTo({
url,
@@ -100,7 +110,7 @@
this.$emit('setAgree', this.isAgree)
}
},
- created() {
+ created() {
this.needAgreements = (config?.agreements?.scope || []).includes(this.scope)
},
data() {
@@ -145,7 +155,7 @@
color: #04498c;
cursor: pointer;
}
-
+
.checkbox-box ::v-deep .uni-checkbox-input{
border-radius: 100%;
}
@@ -155,13 +165,13 @@
color: #FFFFFF !important;
background-color: $uni-color-primary;
}
-
+
.content{
flex-wrap: wrap;
flex-direction: row;
- }
-
- .root ::v-deep .uni-popup__error{
- color: #333333;
+ }
+
+ .root ::v-deep .uni-popup__error{
+ color: #333333;
}
diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue b/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
index eefd629821b484e6984cff8b6e55feb143e5b655..c9248f3bd11a1dd7b384fb5b4e2b71b02d8f4d05 100644
--- a/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
+++ b/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue
@@ -62,22 +62,29 @@
"text": "微信登录",
"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
{
"id": "apple",
"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",
"text": "一键登录",
"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",
"text": "淘宝登录", //暂未提供该登录方式的接口示例
@@ -207,7 +214,7 @@
return '/' + pages[pages.length - n].route
},
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) ==
'/uni_modules/uni-id-pages/pages/login/login-withoutpwd') {
//如果要被打开的页面已经打开,且这个页面是 /uni_modules/uni-id-pages/pages/index/index 则把类型参数传给他
@@ -238,7 +245,7 @@
}
},
async login_before(type, navigateBack = true, options = {}) {
- console.log(type);
+ console.log(type, options);
//提示空实现
if (["qq",
"xiaomi",
@@ -256,15 +263,17 @@
});
}
+ console.log('检查当前环境是否支持这种登录方式')
//检查当前环境是否支持这种登录方式
// #ifdef APP
let isAppExist = true
await new Promise((callback) => {
+ console.log('uni.getProvider', uni.getProvider)
uni.getProvider({
service: 'oauth',
success: (res) => {
const provider = res.providers.find(item => item.id === type)
-
+ console.log('res', res)
if (provider) {
isAppExist = provider?.isAppExist ?? true
callback()
@@ -282,6 +291,7 @@
})
})
// #endif
+
if (
// #ifdef APP
!isAppExist
@@ -347,7 +357,11 @@
}
}
// #endif
+ console.log('login ----')
uni.showLoading({
+ // #ifdef MP-HARMONY
+ title: "正在登录",
+ // #endif
mask: true
})
@@ -425,7 +439,7 @@
})
}
- if (type === 'weixinMobile') {
+ if (type === 'weixinMobile' || type === 'huaweiMobile') {
return this.login({
phoneCode: options.phoneNumberCode
}, type)
@@ -451,7 +465,12 @@
} : e.authResult, type)
},
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()
}
})
@@ -570,6 +589,6 @@
margin-top: 6px;
color: #999;
font-size: 10px;
- width: 70px;
+ width: 80px;
}
diff --git a/uni_modules/uni-id-pages/config.js b/uni_modules/uni-id-pages/config.js
index e847774904015c7b21e0bc94379681b158bed1ea..5d7f2310954602c1aaca2885a9bf931850c984c2 100644
--- a/uni_modules/uni-id-pages/config.js
+++ b/uni_modules/uni-id-pages/config.js
@@ -19,12 +19,18 @@ export default {
// #ifdef APP
'univerify',
// #endif
+ // #ifndef MP-HARMONY
'weixin',
+ // #endif
'username',
// #ifdef APP
'apple',
// #endif
- 'smsCode'
+ 'smsCode',
+ // #ifdef APP-HARMONY || MP-HARMONY
+ 'huawei',
+ 'huaweiMobile'
+ // #endif
],
// 政策协议
agreements: {
diff --git a/uni_modules/uni-id-pages/package.json b/uni_modules/uni-id-pages/package.json
index 8f8326f99230e40be741276bebb7c8dff6f6e6a2..0c7981cfa6cb3e6aa2c29927b7f0b941c5eec097 100644
--- a/uni_modules/uni-id-pages/package.json
+++ b/uni_modules/uni-id-pages/package.json
@@ -1,7 +1,7 @@
{
"id": "uni-id-pages",
"displayName": "uni-id-pages",
- "version": "1.1.23",
+ "version": "1.1.24",
"description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [
"用户管理",
diff --git a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
index 4621f1d49f81502d46a9ae9b02340820dc4e3273..5069707b1f25cfe91ca7dd670b132e35b46c634e 100644
--- a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
+++ b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
@@ -7,13 +7,20 @@
请选择登录方式
-
+
将根据第三方账号服务平台的授权范围获取你的信息
-
-
+
+
+
+
+
@@ -57,7 +64,8 @@
const images = {
weixin: '/uni_modules/uni-id-pages/static/login/weixin.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]
}
@@ -73,7 +81,7 @@
}
this.$nextTick(() => {
//关闭重复显示的登录快捷方式
- if (['weixin', 'apple'].includes(type)) {
+ if (['weixin', 'apple', 'huawei', 'huaweiMobile'].includes(type)) {
this.$refs.uniFabLogin.servicesList = this.$refs.uniFabLogin.servicesList.filter(item =>
item.id != type)
}
@@ -133,14 +141,17 @@
"top": 0
})
},
+ showAgreementModal () {
+ this.$refs.agreements.popup()
+ },
quickLogin(e) {
let options = {}
-
+ console.log(e)
if (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)
},
@@ -187,6 +198,13 @@
}
}
+ .mobile-login-agreement-layer {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ }
.uni-content,
.quickLogin {
/* #ifndef APP-NVUE */
@@ -242,6 +260,9 @@
.quickLoginBtn {
margin: 20px 0;
width: 450rpx;
+ background-color: transparent;
+ border: none;
+ box-shadow: none;
/* #ifndef APP-NVUE */
max-width: 230px;
/* #endif */
diff --git a/uni_modules/uni-id-pages/pages/login/login-withpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withpwd.vue
index cf63ab20b586c9adac82fd03992db4fa26a701eb..36730d03972ce4fca039811ed6ad2cb51b98125b 100644
--- a/uni_modules/uni-id-pages/pages/login/login-withpwd.vue
+++ b/uni_modules/uni-id-pages/pages/login/login-withpwd.vue
@@ -12,8 +12,8 @@
:inputBorder="false" v-model="username" placeholder="请输入手机号/用户名/邮箱" trim="all" />
-
+
diff --git a/uni_modules/uni-id-pages/static/login/apple.png b/uni_modules/uni-id-pages/static/login/apple.png
new file mode 100644
index 0000000000000000000000000000000000000000..556f68666ecdb2a0414fb7f2a5a0d7fa484d6df8
Binary files /dev/null and b/uni_modules/uni-id-pages/static/login/apple.png differ
diff --git a/uni_modules/uni-id-pages/static/login/huawei-mobile.png b/uni_modules/uni-id-pages/static/login/huawei-mobile.png
new file mode 100644
index 0000000000000000000000000000000000000000..60cef559bba9d1da28b174c72a4ea7cf9b49da54
Binary files /dev/null and b/uni_modules/uni-id-pages/static/login/huawei-mobile.png differ
diff --git a/uni_modules/uni-id-pages/static/app/huawei.png b/uni_modules/uni-id-pages/static/login/huawei.png
similarity index 100%
rename from uni_modules/uni-id-pages/static/app/huawei.png
rename to uni_modules/uni-id-pages/static/login/huawei.png
diff --git a/uni_modules/uni-id-pages/static/login/uni-fab-login/apple.png b/uni_modules/uni-id-pages/static/login/uni-fab-login/apple.png
new file mode 100644
index 0000000000000000000000000000000000000000..99082a7945960df8152b4965d115ae3ffec96fc8
Binary files /dev/null and b/uni_modules/uni-id-pages/static/login/uni-fab-login/apple.png differ
diff --git a/uni_modules/uni-id-pages/static/login/uni-fab-login/huawei.png b/uni_modules/uni-id-pages/static/login/uni-fab-login/huawei.png
new file mode 100644
index 0000000000000000000000000000000000000000..c96c3e6e7c1af8eef73a590597440675de6e1cb5
Binary files /dev/null and b/uni_modules/uni-id-pages/static/login/uni-fab-login/huawei.png differ
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
index d5a9a0f99b2607d138c35706f9e5df3f38fd5b19..f5993497ccf4398c041a211b4a8cf53d13117454 100644
--- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js
@@ -34,7 +34,8 @@ const {
loginByQQ,
loginByApple,
loginByWeixinMobile,
- loginByHuawei
+ loginByHuawei,
+ loginByHuaweiMobile
} = require('./module/login/index')
const {
logout
@@ -50,7 +51,10 @@ const {
unbindWeixin,
unbindAlipay,
unbindQQ,
- unbindApple
+ unbindApple,
+ bindHuawei,
+ unbindHuawei,
+ bindMobileByHuawei
} = require('./module/relate/index')
const {
setPwd,
@@ -419,6 +423,7 @@ module.exports = {
loginByApple,
loginByWeixinMobile,
loginByHuawei,
+ loginByHuaweiMobile,
/**
* 用户退出登录
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#logout
@@ -694,5 +699,8 @@ module.exports = {
* @param {Boolean} params.decryptData 是否解密数据
* @returns
*/
- getRealNameInfo
+ getRealNameInfo,
+ bindHuawei,
+ unbindHuawei,
+ bindMobileByHuawei
}
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/huawei.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/huawei.js
new file mode 100644
index 0000000000000000000000000000000000000000..f4387214ffebe05e7f94bcf05a38c4ae386259a1
--- /dev/null
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/huawei.js
@@ -0,0 +1,16 @@
+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
+}
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/index.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/index.js
index 64511a862c5d4140e2d7fafe310d5781a379908a..a31dc7d3652b13b7633b620142d85450761f9552 100644
--- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/index.js
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/index.js
@@ -17,5 +17,6 @@ module.exports = {
loginByFacebook: require('./login-by-facebook'),
loginByGoogle: require('./login-by-google'),
loginByWeixinMobile: require('./login-by-weixin-mobile'),
- loginByHuawei: require('./login-by-huawei')
+ loginByHuawei: require('./login-by-huawei'),
+ loginByHuaweiMobile: require('./login-by-huawei')
}
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-huawei.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-huawei.js
index 4ff92745fa3900ee08e78ee12cfe21c715851855..6a97d393b3c76222c1fdb2d100e4d9c229b79519 100644
--- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-huawei.js
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-huawei.js
@@ -9,10 +9,8 @@ const {
postUnifiedLogin
} = require('../../lib/utils/unified-login')
const {
- generateWeixinCache,
- getWeixinPlatform,
- saveWeixinUserKey,
-} = require('../../lib/utils/weixin')
+ getHuaweiPlatform,
+} = require('../../lib/utils/huawei')
const {
LOG_TYPE
} = require('../../common/constants')
@@ -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 {String} params.code 微信登录返回的code
+ * @param {String} params.code 华为登录返回的code
* @param {String} params.inviteCode 邀请码
* @returns
*/
module.exports = async function (params = {}) {
const schema = {
- code: 'string',
+ code: {
+ type: 'string',
+ required: false
+ },
+ phoneCode: {
+ type: 'string',
+ required: false
+ },
inviteCode: {
type: 'string',
required: false
}
}
this.middleware.validate(params, schema)
+
const {
- code,
inviteCode
} = 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)
- let accountResult
+ let accessToken
try {
- const {accessToken} = await huaweiApi.getUserAccessToken(code)
- accountResult = await huaweiApi.getAccessTokenInfo(accessToken)
- accountResult.accessToken = accessToken
+ const res = await huaweiApi.getUserAccessToken(code)
+
+ if (res.errCode !== 0) {
+ console.error(res)
+ throw new Error(res.errMsg)
+ }
+
+ accessToken = res.accessToken
} catch (error) {
console.error(error)
await this.middleware.uniIdLog({
@@ -60,33 +84,39 @@ module.exports = async function (params = {}) {
}
const {
- openId,
- unionId,
- accessToken
- } = accountResult
+ openID: openId,
+ unionID: unionId,
+ purePhoneNumber: mobile,
+ displayName: nickname,
+ headPictureURL: avatar,
+ } = await huaweiApi.getUserInfo(accessToken)
const {
type,
user
} = await preUnifiedLogin.call(this, {
user: {
- huawei_openid: openId,
- huawei_unionid: unionId
+ huawei_openid: {
+ [huaweiPlatform]: openId
+ },
+ huawei_unionid: unionId,
+ mobile
}
})
const extraData = {
- huawei_openid: openId,
+ huawei_openid: {
+ [`${huaweiPlatform}_${appId}`]: openId
+ },
huawei_unionid: unionId
}
+ if (mobile) {
+ extraData.mobile = mobile
+ extraData.mobile_confirmed = 1
+ }
+
if (type === 'register') {
- const res = await huaweiApi.getUserInfo(accessToken)
- console.log('userinfo', res)
- const {
- displayName: nickname,
- headPictureURL: avatar
- } = res
if (avatar) {
// eslint-disable-next-line n/no-deprecated-api
const avatarPath = url.parse(avatar).pathname
@@ -112,7 +142,6 @@ module.exports = async function (params = {}) {
url: fileID
}
}
-
extraData.nickname = nickname
}
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-huawei.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-huawei.js
new file mode 100644
index 0000000000000000000000000000000000000000..b53c398d4fd4f2398cec3d5338a69c7a9ce8d005
--- /dev/null
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-huawei.js
@@ -0,0 +1,57 @@
+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
+ }
+}
diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/index.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/index.js
index a587e76f2904d99e3068add8cd838837b74e99df..f04fcd4de01468c7b4a9c5095433f661b266b2d0 100644
--- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/index.js
+++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/index.js
@@ -9,5 +9,8 @@ module.exports = {
unbindWeixin: require('./unbind-weixin'),
unbindAlipay: require('./unbind-alipay'),
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'),
}
diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
index 9bc87fc2c71c2e710c0f8e13524c9c20163d45b6..f799e239bff387a7f7326cd9a8ef1d31b1250f25 100644
--- a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
+++ b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue
@@ -10,7 +10,7 @@
-
+