Explorar el Código

重复上报问题

nieyuge hace 1 mes
padre
commit
9d65eddabe

+ 6 - 6
src/hooks/useLogger.ts

@@ -76,7 +76,7 @@ const useLogger = () => {
 		sortType,
 		tags,
 		videoLibraryType,
-	}:VideoListQueryLogParams) => { 
+	}:VideoListQueryLogParams) => {
 		return uploadLog({
 			businessType: 'video_list_query',
 			objectType: 'video_list',
@@ -96,7 +96,7 @@ const useLogger = () => {
 		});
 	}
 
-	const uploadLogVideoPlay = ({videoId, traceId, requestId, planType, gzhAccountId, subChannel}: VideoLogParams) => { 
+	const uploadLogVideoPlay = ({videoId, traceId, requestId, planType, gzhAccountId, subChannel}: VideoLogParams) => {
 		return uploadLog({
 			businessType: 'video_play',
 			objectType: 'video',
@@ -111,7 +111,7 @@ const useLogger = () => {
 		});
 	}
 
-	const uploadLogVideoPlayEnd = ({videoId, playTime, traceId, requestId, planType, gzhAccountId, subChannel}: VideoLogParams) => { 
+	const uploadLogVideoPlayEnd = ({videoId, playTime, traceId, requestId, planType, gzhAccountId, subChannel}: VideoLogParams) => {
 		return uploadLog({
 			businessType: 'video_play_end',
 			objectType: 'video',
@@ -127,7 +127,7 @@ const useLogger = () => {
 		});
 	}
 
-	const uploadLogVideoView = ({videoId, idx, score, tags, title, cover, libraryType, traceId, requestId, planType, gzhAccountId, subChannel}: VideoLogParams) => { 
+	const uploadLogVideoView = ({videoId, idx, score, tags, title, cover, libraryType, traceId, requestId, planType, gzhAccountId, subChannel}: VideoLogParams) => {
 		return uploadLog({
 			businessType: 'video_view',
 			objectType: 'video',
@@ -148,7 +148,7 @@ const useLogger = () => {
 		});
 	}
 
-	const uploadLogVideoCollect = ({videoId, traceId, requestId, collect, planType, gzhAccountId, subChannel}: VideoLogParams) => { 
+	const uploadLogVideoCollect = ({videoId, traceId, requestId, collect, planType, gzhAccountId, subChannel}: VideoLogParams) => {
 		return uploadLog({
 			businessType: 'video_collect',
 			objectType: 'video',
@@ -171,7 +171,7 @@ const useLogger = () => {
 		planType,
 		gzhAccountId,
 		subChannel
-	}: PublishPlanLogParams) => { 
+	}: PublishPlanLogParams) => {
 		return uploadLog({
 			businessType: 'publish_plan_create',
 			objectType: 'publish_plan',

+ 2 - 8
src/views/publishContent/weGZH/components/videoSelectModal/index.tsx

@@ -112,20 +112,14 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ planType, visible,
 		}
 	}
 
-	// 监听视频库类型变化,重新加载数据
-	useEffect(() => {
-		if (visible) {
-			getVideoList();
-		}
-	}, [videoLibraryType, visible]);
-
+	// 监听visible和videoLibraryType变化,重新加载数据
 	useEffect(() => {
 		if (visible) {
 			setVideoList(selectedVideos);
 			setVideoListAll(selectedVideos);
 			getVideoList();
 		}
-	}, [visible]);
+	}, [visible, videoLibraryType, selectedVideos]);
 
 	useEffect(() => {
 		if (visible) {