更新依赖项及历史人物相关内容资源
- 更新 package.json 和 package-lock.json 中的依赖项 - 新增/更新陈云、黄炎培、鲁迅、孙中山的音频文件 - 新增场景和组件的图片资源 - 清理未使用的音频和图片文件 - 优化多个组件和页面的实现逻辑
This commit is contained in:
1 parent
b1d55b9464
commit
e0fa47d21a
629 files changed
+24390
-2991
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { useUserStore } from '@/store/userStore'
|
||||
|
||||
// 声明外部依赖(由运行环境提供)
|
||||
declare const $: any
|
||||
declare const iscallyb: boolean
|
||||
@@ -73,6 +75,11 @@ const LESSON_PREFIX = 'hsgrl'
|
||||
const videoajax: VideoAjax = videoAjax()
|
||||
videoajax.setHost('/')
|
||||
|
||||
function normalizeLessonId(lessonId: string | number): string {
|
||||
const raw = String(lessonId)
|
||||
return raw.startsWith(`${LESSON_PREFIX}_`) ? raw : `${LESSON_PREFIX}_${raw}`
|
||||
}
|
||||
|
||||
// 设置我的自定义数据(所有的自定义数据都设置在第一个课时ID上,以key来区分不同的类型)
|
||||
function setLtDefine(key: string | number, value: string): void {
|
||||
if (iscallyb) {
|
||||
@@ -131,7 +138,7 @@ export function setUserDefine(
|
||||
value: string
|
||||
): void {
|
||||
const param: UserDefineParam = {
|
||||
lessonId: `${LESSON_PREFIX}_${lessonId}`,
|
||||
lessonId: normalizeLessonId(lessonId),
|
||||
key,
|
||||
content: value,
|
||||
}
|
||||
@@ -144,7 +151,7 @@ function getUserDefineAsyncInternal(
|
||||
key: string | number
|
||||
): Promise<string> {
|
||||
const param: UserDefineParam = {
|
||||
lessonId: `${LESSON_PREFIX}_${lessonId}`,
|
||||
lessonId: normalizeLessonId(lessonId),
|
||||
order: key,
|
||||
}
|
||||
|
||||
@@ -179,7 +186,7 @@ function getUsersDefineAsyncInternal(
|
||||
key: string | number
|
||||
): Promise<string | VideoAjaxResponseItem[]> {
|
||||
const param: UserDefineParam = {
|
||||
lessonId: `${LESSON_PREFIX}_${lessonId}`,
|
||||
lessonId: normalizeLessonId(lessonId),
|
||||
order: key,
|
||||
}
|
||||
|
||||
@@ -221,8 +228,9 @@ export async function getUsersDefine(
|
||||
|
||||
// 根据课时顺序号(所处课程的第几课时)更新对应易班平台上的每个环节进度(异步)
|
||||
export async function setCourseTimeProgress(order: number): Promise<void> {
|
||||
const courseid = useUserStore.getState().courseId
|
||||
// var courseid = getCookie(lesson+"_course_id");//获取url链接的课程ID
|
||||
const courseid = await getLtDefine('10000')
|
||||
// const courseid = await getLtDefine('10000')
|
||||
console.info(`courseid:${courseid} order:${order}`)
|
||||
if (iscallyb && courseid !== undefined && courseid !== null && courseid !== '') {
|
||||
if (order > 0) {
|
||||
|
||||
Reference in new issue
Block a user