增加权限认证
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ ENV = 'development'
|
||||
|
||||
# VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7003'
|
||||
|
||||
|
||||
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
+36
-18
@@ -2,7 +2,7 @@
|
||||
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
|
||||
*/
|
||||
|
||||
var isIos
|
||||
let isIos
|
||||
// #ifdef APP-PLUS
|
||||
isIos = (plus.os.name == "iOS")
|
||||
// #endif
|
||||
@@ -80,18 +80,34 @@ function judgeIosPermissionRecord() {
|
||||
|
||||
// 判断相机权限是否开启
|
||||
function judgeIosPermissionCamera() {
|
||||
var result = false;
|
||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
console.log("authStatus:" + authStatus);
|
||||
if (authStatus == 3) {
|
||||
result = true;
|
||||
console.log("相机权限已经开启");
|
||||
} else {
|
||||
console.log("相机权限没有开启");
|
||||
const authSetting = uni.getAppAuthorizeSetting();
|
||||
const state = authSetting.cameraAuthorized;
|
||||
console.log('state', state);
|
||||
switch (state) {
|
||||
case 'authorized':
|
||||
console.log("相机权限已经开启");
|
||||
return 'authorized';
|
||||
case 'denied':
|
||||
return 'denied';
|
||||
case 'not determined':
|
||||
return 'undetermined';
|
||||
case 'config error':
|
||||
return 'undetermined';
|
||||
default:
|
||||
return 'undetermined';
|
||||
}
|
||||
plus.ios.deleteObject(AVCaptureDevice);
|
||||
return result;
|
||||
// var result = false;
|
||||
// var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
// var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
// console.log("authStatus:" + authStatus);
|
||||
// if (authStatus == 3) {
|
||||
// result = true;
|
||||
// console.log("相机权限已经开启");
|
||||
// } else {
|
||||
// console.log("相机权限没有开启");
|
||||
// }
|
||||
// plus.ios.deleteObject(AVCaptureDevice);
|
||||
// return result;
|
||||
}
|
||||
|
||||
// 判断相册权限是否开启
|
||||
@@ -264,9 +280,11 @@ function checkSystemEnableLocation() {
|
||||
}
|
||||
}
|
||||
|
||||
export default ({
|
||||
judgeIosPermission: judgeIosPermission,
|
||||
requestAndroidPermission: requestAndroidPermission,
|
||||
checkSystemEnableLocation: checkSystemEnableLocation,
|
||||
gotoAppPermissionSetting: gotoAppPermissionSetting
|
||||
})
|
||||
|
||||
|
||||
export default {
|
||||
judgeIosPermission,
|
||||
requestAndroidPermission,
|
||||
checkSystemEnableLocation,
|
||||
gotoAppPermissionSetting
|
||||
}
|
||||
@@ -194,19 +194,11 @@
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newVal) => {
|
||||
console.log('modelValue', newVal);
|
||||
// console.log('modelValue', newVal);
|
||||
item_answer.value = typeof newVal === 'string' ? newVal.split(',') : newVal;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
// watch(
|
||||
// item_answer,
|
||||
// (newVal) => {
|
||||
// console.log('item_answer', newVal);
|
||||
// emit('update:modelValue', newVal);
|
||||
// },
|
||||
// { deep: true }
|
||||
// );
|
||||
|
||||
const feedback_click = () => {
|
||||
emit('subject_click', 'feedback', props.item);
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
const pkData = reactive({
|
||||
comLimit: 0,
|
||||
crsId: '',
|
||||
comId: '',
|
||||
name: '', // 名称
|
||||
orgId: '',
|
||||
papersId: '',
|
||||
@@ -247,7 +248,7 @@
|
||||
traQnsInfoVo = res.body.traQnsInfoVo;
|
||||
}
|
||||
topic.value.isPreview = true; // 不能在点击了,打开预览模式
|
||||
console.log('给出来的traQnsInfoVo', traQnsInfoVo);
|
||||
// console.log('给出来的traQnsInfoVo', traQnsInfoVo);
|
||||
common.hideLoading();
|
||||
topic.value.clearResult = false; // 不清除正确答案
|
||||
topic.value.analyContent = traQnsInfoVo.analyContent; // 答案解析
|
||||
@@ -257,7 +258,6 @@
|
||||
topic.value.judgeResult = traQnsInfoVo.judgeResult; // 正确答案字符串分割
|
||||
|
||||
if (questionNumber.value >= topicList.length - 1) {
|
||||
console.log('pk页答完了,带走的数据', pkData);
|
||||
common.setPageCache('competition_pk_to_resulf', pkData);
|
||||
nextTick(() => {
|
||||
common.redirectTo(
|
||||
@@ -418,7 +418,7 @@
|
||||
}
|
||||
nextTick(() => {
|
||||
common.redirectTo(
|
||||
`/pages/competition/result?mode=${mode}&execId=${pkData.execId}&orgId=${pkData.orgId}&papersId=${pkData.papersId}&autoSub=01`
|
||||
`/pages/competition/result?mode=${mode}&execId=${pkData.execId}&orgId=${pkData.orgId}&papersId=${pkData.papersId}&autoSub=01&comId=${pkData.comId}`
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
import points from '@/components/points-and-badge/points';
|
||||
import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge';
|
||||
import { initRecord } from '@/composables/useExamSubject.js';
|
||||
import permissionApi from '@/common/permission'
|
||||
const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge();
|
||||
|
||||
const socketStore = useSocketStore();
|
||||
@@ -252,8 +253,9 @@
|
||||
console.log('申请权限');
|
||||
await initRecord();
|
||||
}
|
||||
// console.log('水水水水水水水水', permissionApi.judgeIosPermission('camera'));
|
||||
|
||||
//#endif
|
||||
|
||||
common.setPageCache('tipMsgsceneDesc', {
|
||||
ossAddr: detailInfo.value.ossAddr,
|
||||
chaName: detailInfo.value.chaName,
|
||||
|
||||
Reference in New Issue
Block a user