Browse Source

录音权限bug

cxmo 2 years ago
parent
commit
95ebdda52a
1 changed files with 12 additions and 0 deletions
  1. 12 0
      pages-question/answerDetail.vue

+ 12 - 0
pages-question/answerDetail.vue

@@ -226,6 +226,17 @@ export default {
     this.initAudio();
     this.getQuestionItem(options.id);
   },
+  onShow(){
+    uni.authorize({
+      scope: 'scope.record',
+      success() {
+        
+      },
+      fail(e){
+        console.log('fail',e);
+      }
+    })
+  },
   onUnload() {
     this.resetAudio();
     this.destroyAudio();
@@ -395,6 +406,7 @@ export default {
         //检查是否有权限
         uni.getSetting({
           success(res){
+            console.log('res',res)
             if(res.authSetting['scope.record']){
               that.startRecord()
             }else{