Skip to content

Commit 465740d

Browse files
committed
fix: 修复联系人权限判断问题
1 parent 73de9db commit 465740d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

common/permission.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ function contact() {
8585
var result = 0;
8686
var CNContactStore = plus.ios.import("CNContactStore");
8787
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
88-
if (authStatus === 0) {
88+
if (cnAuthStatus === 0) {
8989
result = null;
90-
} else if (authStatus == 3) {
90+
} else if (cnAuthStatus == 3) {
9191
result = 1;
9292
} else {
9393
result = 0;

pages/API/add-phone-contact/add-phone-contact.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@
4747
phoneChange: function(e) {
4848
this.phone = e.detail.value
4949
},
50-
add() {
50+
async add() {
5151
// #ifdef APP-PLUS
52-
if (this.checkPermission() !== 1) {
53-
return;
52+
let status = await this.checkPermission();
53+
if (status !== 1) {
54+
return;
5455
}
5556
// #endif
5657

0 commit comments

Comments
 (0)