|
@@ -246,14 +246,16 @@ onMounted(() => {
|
|
|
if (activeElementIdList.value.length) {
|
|
|
nextTick(() => mainStore.setActiveElementIdList([]))
|
|
|
}
|
|
|
+ // 优化:避免重复代码,统一设置 window.pptLoading
|
|
|
+ if (typeof window !== 'undefined') {
|
|
|
+ (window as any).pptLoading = 1
|
|
|
+ }
|
|
|
if (props.courseid) {
|
|
|
- // 优化暴露到 window 对象的方式,避免重复赋值
|
|
|
- if (typeof window !== 'undefined') {
|
|
|
- const win = window as any
|
|
|
- win.pptLoading = 1
|
|
|
- }
|
|
|
getCourseDetail()
|
|
|
}
|
|
|
+ else {
|
|
|
+ (window as any).pptLoading = 2
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
const getCourseDetail = async () => {
|