You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
739 B

3 years ago
<template>
<view class="container">
<button class="confirm-btn" @click="login1">微信授权登录</button>
<view class="v">
{{text}}
</view>
3 years ago
</view>
</template>
<script>
export default {
data() {
return {
text: ''
3 years ago
}
},
onLoad() {
3 years ago
3 years ago
},
methods: {
login1() {
uni.login({
provider: 'weixin',
success: function (loginRes) {
console.log(loginRes);
// 获取用户信息
uni.getUserInfo({
provider: 'weixin',
success: function (infoRes) {
console.log('用户昵称为:' + JSON.stringify(infoRes));
}
});
}
});
}
3 years ago
}
}
</script>
<style>
.v {
white-space: normal;
word-wrap: break-word;
}
3 years ago
</style>