增加权限验证模块

Signed-off-by: YangWork <yang@xixingwl.cn>
This commit is contained in:
YangWork
2023-02-08 18:02:15 +08:00
parent 1d50b93bf0
commit c6caad4bc8
27 changed files with 2896 additions and 21 deletions

View File

@@ -1,25 +1,27 @@
<template>
<view
style="height: 100vh;display: flex;flex-direction: column;align-items: center;justify-content: center;box-sizing: border-box;">
<button class="avatar-wrapper" open-type="chooseAvatar" @tap="onChooseAvatar">
<image class="avatar" :src="avatarUrl"></image>
</button>
<input type="nickname" class="weui-input" placeholder="请输入昵称" />
<button type="primary" block open-type="getUserInfo" @getuserinfo="appLoginWx">
微信一键登录
</button>
<button v-show="showPhone" type="primary" block open-type="getPhoneNumber" @getphonenumber="getPhone">
授权电话
</button>
style="height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;">
<ywx-auth-model></ywx-auth-model>
<view style="padding: 35rpx;">
<button type="primary" block open-type="getUserInfo" @getuserinfo="appLoginWx">
微信一键登录
</button>
</view>
</view>
</template>
<script>
//1.导入组件这步属于传统vue规范但在uni-app的easycom下可以省略这步
import ywxAuthModel from "@/components/ywx-auth-model/ywx-auth-model.vue";
export default {
//2.注册组件这步属于传统vue规范但在uni-app的easycom下可以省略这步
components: {
ywxAuthModel
},
data() {
return {
avatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0',
openid: "",
loginstate: "0",
openid: "",
@@ -32,13 +34,6 @@
},
onLoad: function() {},
methods: {
onChooseAvatar(e) {
console.log(e)
const {
avatarUrl
} = e.detail
this.avatarUrl = avatarUrl
},
// 授权获取微信用户信息
appLoginWx(res) {
console.log(res)