修改bug
This commit is contained in:
+5
-5
@@ -6,7 +6,7 @@ ENV = 'development'
|
||||
|
||||
|
||||
# app入口
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
#VITE_APP_BASE_API_Url = 'http://25.16.122.65:7001'
|
||||
#VITE_APP_BASE_API_Url = 'http://25.16.122.91:9786'
|
||||
#VITE_APP_BASE_API_Url = 'http://25.18.122.66:9786'
|
||||
@@ -16,20 +16,20 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.16.122.65:7001'
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.21:9786'
|
||||
|
||||
#VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
|
||||
|
||||
# dev
|
||||
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
# sit
|
||||
#VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
|
||||
|
||||
# UAT
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
|
||||
|
||||
# 任东
|
||||
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601'
|
||||
VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
|
||||
# VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
|
||||
|
||||
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.140:9604'
|
||||
# 张建成
|
||||
|
||||
@@ -351,9 +351,10 @@
|
||||
const qnsId = topic.value.qnsId;
|
||||
console.log('asdsadas', answerCacheList.value);
|
||||
const newCache = { ...answerCacheList.value };
|
||||
if(topic.value.qnsTyp === 'ES') { // 问答题特殊处理
|
||||
if('anserResult' in my_answer && my_answer.anserResult !== '') {
|
||||
newCache[qnsId] = {...my_answer, voicePath:''};
|
||||
if (topic.value.qnsTyp === 'ES') {
|
||||
// 问答题特殊处理
|
||||
if ('anserResult' in my_answer && my_answer.anserResult !== '') {
|
||||
newCache[qnsId] = { ...my_answer, voicePath: '' };
|
||||
} else {
|
||||
delete newCache[qnsId];
|
||||
}
|
||||
@@ -385,24 +386,84 @@
|
||||
// 设置缓存的键的名称
|
||||
const suffix = mode === 'PAPERS' ? paperData.examId : paperData.crsId;
|
||||
examinationAnswerCacheKey = 'examinationAnswerCache' + suffix;
|
||||
answerCacheList.value = common.getValue(examinationAnswerCacheKey) ?? {};
|
||||
console.log('刚进入', answerCacheList.value);
|
||||
answerCacheList.value = common.getValue(examinationAnswerCacheKey);
|
||||
if (typeof answerCacheList.value !== 'object') {
|
||||
answerCacheList.value = {};
|
||||
}
|
||||
|
||||
topicList.push(
|
||||
...examination.qnsInfoVos.map((res) => {
|
||||
const es_status =
|
||||
paperData.isCacheExam === 'N'
|
||||
? ''
|
||||
: res.qnsId in answerCacheList.value
|
||||
? 'ossKey' in answerCacheList.value[res.qnsId]
|
||||
? '02'
|
||||
: '01'
|
||||
: '';
|
||||
const my_answer =
|
||||
paperData.isCacheExam === 'N'
|
||||
? []
|
||||
: res.qnsId in answerCacheList.value
|
||||
? answerCacheList.value[res.qnsId]
|
||||
: [];
|
||||
// const es_status =
|
||||
// paperData.isCacheExam === 'N'
|
||||
// ? ''
|
||||
// : res.qnsId in answerCacheList.value
|
||||
// ? 'ossKey' in answerCacheList.value[res.qnsId]
|
||||
// ? '02'
|
||||
// : '01'
|
||||
// : '';
|
||||
const es_status = (() => {
|
||||
try {
|
||||
// 基础数据校验
|
||||
if (!paperData || typeof paperData !== 'object') return '';
|
||||
if (paperData.isCacheExam === 'N') return '';
|
||||
|
||||
// 缓存列表校验
|
||||
if (!answerCacheList?.value || typeof answerCacheList.value !== 'object') return '';
|
||||
|
||||
// 问题ID校验
|
||||
if (!res || !res.qnsId || typeof res.qnsId !== 'string') return '';
|
||||
|
||||
// 检查缓存中是否存在该问题
|
||||
if (!(res.qnsId in answerCacheList.value)) return '';
|
||||
|
||||
const cachedAnswer = answerCacheList.value[res.qnsId];
|
||||
if (!cachedAnswer || typeof cachedAnswer !== 'object') return '01';
|
||||
|
||||
// 最终判断
|
||||
return 'ossKey' in cachedAnswer ? '02' : '01';
|
||||
} catch (error) {
|
||||
// 捕获所有意外错误,如变量未定义、类型异常等
|
||||
console.error('获取es_status出错:', error);
|
||||
return ''; // 错误情况下的默认值,可根据业务调整
|
||||
}
|
||||
})();
|
||||
// const my_answer =
|
||||
// paperData.isCacheExam === 'N'
|
||||
// ? []
|
||||
// : res.qnsId in answerCacheList.value
|
||||
// ? answerCacheList.value[res.qnsId]
|
||||
// : [];
|
||||
const my_answer = (() => {
|
||||
try {
|
||||
// 基础数据校验
|
||||
if (!paperData || typeof paperData !== 'object') {
|
||||
return [];
|
||||
}
|
||||
// 如果不需要缓存,直接返回空数组
|
||||
if (paperData.isCacheExam === 'N') {
|
||||
return [];
|
||||
}
|
||||
// 校验缓存列表是否存在且为对象类型
|
||||
if (!answerCacheList?.value || typeof answerCacheList.value !== 'object') {
|
||||
return [];
|
||||
}
|
||||
// 校验问题ID是否有效
|
||||
if (!res || typeof res.qnsId === 'undefined') {
|
||||
return [];
|
||||
}
|
||||
// 检查缓存中是否存在该问题的答案
|
||||
if (res.qnsId in answerCacheList.value) {
|
||||
const cachedAnswer = answerCacheList.value[res.qnsId];
|
||||
// 确保返回值是数组类型(根据原逻辑推测应该返回数组)
|
||||
return Array.isArray(cachedAnswer) ? cachedAnswer : [];
|
||||
}
|
||||
// 缓存中不存在时返回空数组
|
||||
return [];
|
||||
} catch (error) {
|
||||
console.error('获取my_answer出错:', error);
|
||||
return []; // 任何异常都返回空数组,保证程序稳定性
|
||||
}
|
||||
})();
|
||||
return {
|
||||
...res,
|
||||
mark: false,
|
||||
|
||||
Reference in New Issue
Block a user