819527061@qq.com
2024-06-25 7d91779d2bb2bfec7f4f803a9e2cf65b90e401c6
pages/login/resetPassword/resetPassword.vue
@@ -126,7 +126,7 @@
        const regex2 = /^[A-Za-z]+$/
        // 校验符号
        const regex3 =
            /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/
            /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/;
        if(regex1.test(value)) {
          this.level.push('low')
          return callback('密码强度过低')
@@ -223,6 +223,10 @@
      onReady() {
         this.$refs.uForm.setRules(this.rules)
      },
    onShow(){
      this.userAuthorization();
    },
      methods: {
         getUserInfo(phone, idCard) {
            this.$reqGet('phoneAndCard', { phone, idCard }).then(res => {
@@ -234,6 +238,42 @@
            })
         },
      userAuthorization() {
            wx.getSetting({
               success(res) {
                  // wx.startRecord();
                  console.log('授权相机/麦克风权限success');
                  if (!res.authSetting['scope.record'] || !res.authSetting['scope.camera']) {
                     if (!res.authSetting['scope.camera']) {
                        wx.authorize({
                           scope: 'scope.camera',
                           success() {
                              // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                              console.log('授权成功');
                           },
                           fail() {
                              console.log('授权失败');
                           }
                        });
                     } else if (!res.authSetting['scope.record']) {
                        wx.authorize({
                           scope: 'scope.record',
                           success() {
                              // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                              console.log('授权成功');
                           },
                           fail: () => {
                              console.log('授权失败');
                           }
                        });
                     }
                  }
               },
               fail() {
                  console.log('获取失败');
               }
            });
         },
         checkChange(name) {
            this.inputType = name.length === 0 ? 'password' : ''
            this.isFocus = true