|
@@ -883,15 +883,12 @@ export const refreshView = () => {
|
|
|
}, 100)
|
|
|
}
|
|
|
}
|
|
|
-type IFeature = 'UNIT_TEST' | 'PRACTICE' | 'EVALUATION' //UNIT_TEST("单元测试"),PRACTICE("练习"),EVALUATION("评测")
|
|
|
const updatePlayTime = async (time: number) => {
|
|
|
+ const search = useOriginSearch()
|
|
|
+ const behaviorId = sessionStorage.getItem('behaviorId') || search.behaviorId || initBehaviorId
|
|
|
+ const prefix = getRequestHostname()
|
|
|
+ const clientType = useClientType()
|
|
|
if (!state.evaluatingStatus) {
|
|
|
- const search = useOriginSearch()
|
|
|
- const behaviorId = sessionStorage.getItem('behaviorId') || search.behaviorId || initBehaviorId
|
|
|
- const prefix = getRequestHostname()
|
|
|
- const clientType = useClientType()
|
|
|
- console.log("🚀 ~ clientType", clientType)
|
|
|
- const feature: IFeature = (search.feature as IFeature) || 'PRACTICE'
|
|
|
// 如果是后台不需要统计时长
|
|
|
if (clientType === 'web') return
|
|
|
try {
|
|
@@ -901,7 +898,7 @@ const updatePlayTime = async (time: number) => {
|
|
|
data: {
|
|
|
musicSheetId: getLinkId(),
|
|
|
sysMusicScoreId: getLinkId(),
|
|
|
- feature,
|
|
|
+ feature: search.feature,
|
|
|
playTime: time,
|
|
|
deviceType: getPlatform(),
|
|
|
behaviorId,
|
|
@@ -909,30 +906,31 @@ const updatePlayTime = async (time: number) => {
|
|
|
})
|
|
|
event.emit('updatePlayTimeSuccess', res.data)
|
|
|
} catch (error) {}
|
|
|
- //课后训练
|
|
|
- if (search.lessonTrainingId) {
|
|
|
- try {
|
|
|
- console.log(prefix)
|
|
|
- const res = await request.post('/studentLessonTraining/lessonTrainingRecord', {
|
|
|
- prefix: prefix,
|
|
|
- requestType: 'json',
|
|
|
- data: {
|
|
|
- materialType: 'SONG',
|
|
|
- record: {
|
|
|
- clientType: (clientType as string)?.toLocaleUpperCase(),
|
|
|
- feature: 'LESSON_TRAINING',
|
|
|
- deviceType: browserInfo.android ? 'ANDROID' : browserInfo.isApp ? 'IOS' : 'WEB',
|
|
|
- behaviorId,
|
|
|
- playTime: time,
|
|
|
- musicSheetId: getLinkId(),
|
|
|
- },
|
|
|
- courseScheduleId: search.courseScheduleId,
|
|
|
- lessonTrainingId: search.lessonTrainingId,
|
|
|
- materialId: search.materialId,
|
|
|
+
|
|
|
+ }
|
|
|
+ //课后训练
|
|
|
+ if (search.lessonTrainingId) {
|
|
|
+ try {
|
|
|
+ console.log(prefix)
|
|
|
+ const res = await request.post('/studentLessonTraining/lessonTrainingRecord', {
|
|
|
+ prefix: prefix,
|
|
|
+ requestType: 'json',
|
|
|
+ data: {
|
|
|
+ materialType: 'SONG',
|
|
|
+ record: {
|
|
|
+ clientType: (clientType as string)?.toLocaleUpperCase(),
|
|
|
+ feature: search.feature,
|
|
|
+ deviceType: browserInfo.android ? 'ANDROID' : browserInfo.isApp ? 'IOS' : 'WEB',
|
|
|
+ behaviorId,
|
|
|
+ playTime: time,
|
|
|
+ musicSheetId: getLinkId(),
|
|
|
},
|
|
|
- })
|
|
|
- } catch (error) {}
|
|
|
- }
|
|
|
+ courseScheduleId: search.courseScheduleId,
|
|
|
+ lessonTrainingId: search.lessonTrainingId,
|
|
|
+ materialId: search.materialId,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
}
|
|
|
|