Skip to content

Commit 581a8d2

Browse files
committed
fix: 修复APP端未登录状态获取用户信息报错的BUG
1 parent 5c849d6 commit 581a8d2

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎pages/API/get-user-info/get-user-info.vue‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
let content = error.errMsg;
6262
if (~content.indexOf('uni.login')) {
6363
content = '请在登录页面完成登录操作';
64-
}
64+
}
65+
// #ifndef APP-PLUS
6566
uni.getSetting({
6667
success: (res) => {
6768
let authStatus = res.authSetting['scope.userInfo'];
@@ -83,7 +84,15 @@
8384
});
8485
}
8586
}
86-
})
87+
})
88+
// #endif
89+
// #ifdef APP-PLUS
90+
uni.showModal({
91+
title: '获取用户信息失败',
92+
content: '错误原因' + content,
93+
showCancel: false
94+
});
95+
// #endif
8796
}
8897
});
8998
},

0 commit comments

Comments
 (0)