接入uni云

This commit is contained in:
唐明明
2021-07-23 15:26:20 +08:00
parent 8407323932
commit 1ac15128db
21 changed files with 1093 additions and 3943 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="content">
<button type="default" @click="login">登录</button>
<view class="content">
</view>
</template>
@@ -16,50 +16,7 @@
},
methods: {
login(){
uni.login({
provider: 'univerify',
univerifyStyle: {
fullScreen: true,
authButton: {
normalColor : "#c82626",
borderRadius: 0
},
buttons: {
list: [{
provider : "微信",
iconPath : "/static/icons/wechat.png"
}]
},
otherLoginButton: {
borderColor : "#c82626",
title : "其他手机号码登录",
borderRadius: 0,
textColor : "#c82626"
},
privacyTerm: {
privacyItems: [{
url : "https://baidu.com",
title : "用户服务协议"
}]
}
},
success : auth => {
uniCloud.callFunction({
name: "",
data: {
access_token: auth.authResult.access_token,
openid : auth.authResult.openid
}
}).then(res => {
console.log(res)
})
},
fail : err => {
console.log(err)
}
})
}
}
}
</script>

View File

@@ -1,32 +1,61 @@
<template>
<view>
<button type="default" @click="login">登录</button>
</view>
</template>
<script>
export default {
data() {
<template>
<view class="content">
<button type="default" @click="login">登录</button>
</view>
</template>
<script>
export default {
data() {
return {
}
},
mounted() {
},
}
},
onLoad() {
},
methods: {
login(){
uni.login({
provider: 'univerify',
univerifyStyle: {
fullScreen: true
fullScreen: true,
authButton: {
normalColor : "#c82626",
borderRadius: 0
},
buttons: {
list: [{
provider : "微信",
iconPath : "/static/icons/wechat.png"
}]
},
otherLoginButton: {
borderColor : "#c82626",
title : "其他手机号码登录",
borderRadius: 0,
textColor : "#c82626"
},
privacyTerm: {
privacyItems: [{
url : "https://baidu.com",
title : "用户服务协议"
}]
}
},
success : auth => {
console.log(auth)
},
fail : err => {
console.log(err)
}
})
}
}
}
</script>
<style>
}
}
</script>
<style>
</style>