一键登录,增加云函数
This commit is contained in:
@@ -22,9 +22,9 @@
|
||||
<view class="auth-agreement">
|
||||
登录即表示同意<navigator hover-class="none" url="/pages/vip/agreement?id=3">用户协议</navigator>和<navigator hover-class="none" url="/pages/vip/agreement?id=4">隐私政策</navigator>
|
||||
</view>
|
||||
<!-- <view class="auth-other">
|
||||
<button @click="login('mnemonic')">使用助记词登录</button>
|
||||
</view> -->
|
||||
<view class="auth-other">
|
||||
<button @click="login('Akey')">使用本机号码一键登录</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -44,6 +44,9 @@
|
||||
sendCode : '获取验证码',
|
||||
isShowParent: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 获取验证码
|
||||
@@ -109,12 +112,39 @@
|
||||
});
|
||||
return
|
||||
}
|
||||
if (type === 'mnemonic') {
|
||||
uni.showToast({
|
||||
title: '助记词登录暂未开放,敬请期待~',
|
||||
icon: 'none'
|
||||
})
|
||||
if (type === 'Akey') {
|
||||
this.onKeyLogin()
|
||||
}
|
||||
},
|
||||
// 一键登录
|
||||
onKeyLogin(){
|
||||
uni.login({
|
||||
provider:'univerify',
|
||||
univerifyStyle:{
|
||||
icon: {
|
||||
path: require('@/static/logo.png')
|
||||
},
|
||||
authButton: {
|
||||
normalColor: '#34CE98',
|
||||
highlightColor: '#25b381',
|
||||
disabledColor: '#25b381'
|
||||
},
|
||||
otherLoginButton: {
|
||||
visible: false
|
||||
},
|
||||
privacyTerms: {
|
||||
termsColor: '#34CE98',
|
||||
uncheckedImage: require('@/static/icon/unchecked-icon.png'),
|
||||
checkedImage: require('@/static/icon/checked-icon.png')
|
||||
}
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,7 +238,7 @@
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-size: 28rpx;
|
||||
padding: 30rpx 0 100rpx 0;
|
||||
padding: 30rpx 0 60rpx 0;
|
||||
|
||||
navigator {
|
||||
display: inline-block;
|
||||
@@ -219,7 +249,6 @@
|
||||
|
||||
.auth-other {
|
||||
padding: 0 10vw;
|
||||
|
||||
button {
|
||||
height: 100rpx;
|
||||
line-height: 98rpx;
|
||||
|
||||
Reference in New Issue
Block a user