公共登录类
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { auth } from '@/apis/interfaces/auth'
|
||||
import { auth } from '@/apis/interfaces/auth'
|
||||
import keyPhone from '@/public/keyPhone'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -14,52 +15,14 @@
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
console.log(this.$store.state)
|
||||
},
|
||||
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 : result => {
|
||||
console.log(result)
|
||||
auth({
|
||||
access_token: result.authResult.access_token,
|
||||
openid : result.authResult.openid
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
fail : err => {
|
||||
uni.showToast({
|
||||
title: err.errMsg
|
||||
})
|
||||
console.log(err)
|
||||
}
|
||||
keyPhone.keyAuth().then(res => {
|
||||
console.log(res)
|
||||
}).catch(err =>{
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user