Skip to content

Commit

Permalink
Merge pull request eee555#34 from putianyi889/debug-2
Browse files Browse the repository at this point in the history
重做上传录像功能
  • Loading branch information
eee555 authored May 12, 2024
2 parents bf3614f + aa599dc commit 82ca2f2
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 178 deletions.
5 changes: 5 additions & 0 deletions back_end/saolei/videomanager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ def video_upload(request):
# 如果标识是首次使用的,需要得到管理员的审核
data['review_code'] = 2

# 查重
collisions = list(VideoModel.objects.filter(timems=data["timems"], bv=data["bv"]).filter(video__cl=data["cl"], video__op=data["op"], video__isl=data["isl"], video__designator=data["designator"]))
if collisions:
return JsonResponse({"status": 200, "msg": "录像已存在"})

# 表中添加数据
e_video = ExpandVideoModel.objects.create(designator=data["designator"],
left=data["left"], right=data["right"],
Expand Down
3 changes: 0 additions & 3 deletions front_end/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
<el-menu-item index="7" @click="router.push('/player/' + proxy.$store.state.user.id)">
<div class="header">我的地盘</div>
</el-menu-item>
<el-menu-item index="8" @click="router.push('/upload')">
<div class="header">上传录像</div>
</el-menu-item>
<div
style="margin-left: auto;margin-right: 16px;display: inline-flex;justify-content: center;align-items: center;">
<Menu @login="user_login" @logout="user_logout" style=""></Menu>
Expand Down
6 changes: 5 additions & 1 deletion front_end/src/views/PlayerView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
<el-tab-pane label="全部录像" name="second" :lazy="true">
<PlayerVideosView></PlayerVideosView>
</el-tab-pane>

<el-tab-pane v-if="store.state.user.id + '' == userid" label="上传录像" name="third" :lazy="true">
<UploadView :designators="designators"></UploadView>
</el-tab-pane>
</el-tabs>

</el-main>
Expand All @@ -94,6 +96,7 @@ import useCurrentInstance from "@/utils/common/useCurrentInstance";
// import PreviewDownload from '@/components/PreviewDownload.vue';
import PlayerRecordView from '@/views/PlayerRecordView.vue';
import PlayerVideosView from '@/views/PlayerVideosView.vue';
import UploadView from './UploadView.vue';
// const AsyncPlayerVideosView = defineAsyncComponent(() => import('@/views/PlayerVideosView.vue'));
Expand All @@ -106,6 +109,7 @@ const imageUrl = ref(require('@/assets/person.png'))
const avatar_changed = ref(false);
import { Record, RecordBIE } from "@/utils/common/structInterface";
import { compress, compressAccurately } from 'image-conversion';
import store from '@/store';
const loading = ref(true)
Expand Down
Loading

0 comments on commit 82ca2f2

Please sign in to comment.