|
@@ -475,25 +475,39 @@ module.exports = {
|
|
|
// 权限映射配置
|
|
// 权限映射配置
|
|
|
let permisionID = '';
|
|
let permisionID = '';
|
|
|
let permisionIosID = '';
|
|
let permisionIosID = '';
|
|
|
-
|
|
|
|
|
- if (permission == 'location') {
|
|
|
|
|
- permisionID = 'android.permission.ACCESS_FINE_LOCATION';
|
|
|
|
|
- permisionIosID = 'location';
|
|
|
|
|
- }
|
|
|
|
|
- if (permission == 'camera') {
|
|
|
|
|
- permisionID = 'android.permission.CAMERA,android.permission.READ_EXTERNAL_STORAGE';
|
|
|
|
|
- permisionIosID = 'camera,photoLibrary';
|
|
|
|
|
- }
|
|
|
|
|
- if (permission == 'microphone') {
|
|
|
|
|
- permisionID = 'android.permission.RECORD_AUDIO';
|
|
|
|
|
- permisionIosID = 'record';
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
return new Promise(async (resolve) => {
|
|
return new Promise(async (resolve) => {
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
resolve(true);
|
|
resolve(true);
|
|
|
return;
|
|
return;
|
|
|
// #endif
|
|
// #endif
|
|
|
|
|
+
|
|
|
|
|
+ const appAuthorizeSetting = uni.getAppAuthorizeSetting()
|
|
|
|
|
+ if (permission == 'location') {
|
|
|
|
|
+ permisionID = 'android.permission.ACCESS_FINE_LOCATION';
|
|
|
|
|
+ permisionIosID = 'location';
|
|
|
|
|
+ if(appAuthorizeSetting.locationAuthorized=='authorized'){
|
|
|
|
|
+ resolve(true);
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (permission == 'camera') {
|
|
|
|
|
+ permisionID = 'android.permission.CAMERA,android.permission.READ_EXTERNAL_STORAGE';
|
|
|
|
|
+ permisionIosID = 'camera,photoLibrary';
|
|
|
|
|
+ if(appAuthorizeSetting.cameraAuthorized=='authorized'){
|
|
|
|
|
+ resolve(true);
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (permission == 'microphone') {
|
|
|
|
|
+ permisionID = 'android.permission.RECORD_AUDIO';
|
|
|
|
|
+ permisionIosID = 'record';
|
|
|
|
|
+ if(appAuthorizeSetting.microphoneAuthorized=='authorized'){
|
|
|
|
|
+ resolve(true);
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 特殊处理:相机权限在非iOS平台显示自定义弹窗
|
|
// 特殊处理:相机权限在非iOS平台显示自定义弹窗
|
|
|
if (uni.getSystemInfoSync().platform != 'ios') {
|
|
if (uni.getSystemInfoSync().platform != 'ios') {
|
|
|
switch(perpop){
|
|
switch(perpop){
|