quanyawei
2023-10-31 5fecc9e46d448df3de987504440c4fdd582f858e
pages/login/login.vue
@@ -29,6 +29,7 @@
            <u-button @click="submit">登录</u-button>
         </view>
      </view>
      <ws-wx-privacy id="privacy-popup" enableAutoProtocol></ws-wx-privacy>
   </view>
</template>
<script>
@@ -44,6 +45,7 @@
   export default {
      data() {
         return {
            titlePrivacy: '用户隐私保护提示',
            labelStyle: {
               color: '#fff'
            },
@@ -81,9 +83,23 @@
         uni.hideHomeButton()
      },
      methods: {
         doRequire() {
            uni.requirePrivacyAuthorize({
               success: () => {
                  console.log('同意')
                  // 用户同意授权
                  // 继续小程序逻辑
                  this.getlogin()
               },
               fail: () => {
                  console.log('拒绝')
               }, // 用户拒绝授权
               complete: () => {}
            })
         },
         submit() {
            this.$refs.uForm.validate().then(res => {
               this.getlogin()
               this.doRequire()
            }).catch(errors => {})
         },
         //登录