refactor(study): 移除调试日志并优化视频时间获取逻辑

在ExamTest组件中移除已注释的调试日志
在courseDetail组件中增加视频元素存在性检查,避免潜在错误
This commit is contained in:
yindongqi 2025-08-15 14:08:17 +08:00
parent f7eca311fa
commit fc801620c0
2 changed files with 6 additions and 2 deletions

View File

@ -590,7 +590,7 @@ export default {
}, },
mounted() { mounted() {
console.log(this.loginInfo); // console.log(this.loginInfo);
this.start(); this.start();
}, },

View File

@ -343,8 +343,12 @@ export default {
// //
function timer() { function timer() {
// console.log(""); // console.log("");
const video = document.getElementById("video");
let curTime;
if(video) {
curTime = video.currentTime;
}
let curTime = document.getElementById("video").currentTime;
let apartTime = curTime - _this.current_sign; let apartTime = curTime - _this.current_sign;
if (apartTime > 2 && _this.section[_this.choose_section_index].is_end != 1) { if (apartTime > 2 && _this.section[_this.choose_section_index].is_end != 1) {
document.getElementById("video").currentTime = _this.current_sign; document.getElementById("video").currentTime = _this.current_sign;