From 9962136fc8b62576a856fc1b73d626c1a84f09c4 Mon Sep 17 00:00:00 2001 From: lzcode Date: Fri, 16 Oct 2026 16:05:01 +0800 Subject: [PATCH] 1 --- admin/src/api/videos.js | 5 + admin/src/layout/MainLayout.vue | 2 + admin/src/router/index.js | 12 + admin/src/views/CategoryManage.vue | 168 ++++++++ admin/src/views/CreateVideo.vue | 12 +- admin/src/views/SeriesManage.vue | 10 +- admin/src/views/TagManage.vue | 178 +++++++++ admin/src/views/VideoList.vue | 181 +++++++-- app/lib/core/player/feed_player_pool.dart | 50 ++- app/lib/screens/feed/feed_screen.dart | 6 - .../screens/feed/widgets/feed_video_page.dart | 118 ++++-- .../screens/feed/widgets/interaction_bar.dart | 7 - .../feed/widgets/video_player_view.dart | 200 ++++++++-- app/lib/screens/home/home_shell.dart | 1 + .../screens/player/simple_player_screen.dart | 371 +++++++++++++++--- .../api/v1/__pycache__/admin.cpython-311.pyc | Bin 43197 -> 60702 bytes server/app/api/v1/admin.py | 309 +++++++++++++-- .../__pycache__/admin_service.cpython-311.pyc | Bin 91076 -> 91224 bytes server/app/services/admin_service.py | 3 + 19 files changed, 1425 insertions(+), 208 deletions(-) create mode 100644 admin/src/views/CategoryManage.vue create mode 100644 admin/src/views/TagManage.vue diff --git a/admin/src/api/videos.js b/admin/src/api/videos.js index 22668eb..a33a63e 100644 --- a/admin/src/api/videos.js +++ b/admin/src/api/videos.js @@ -20,3 +20,8 @@ export function reviewVideo(videoId, data) { export function offlineVideo(videoId, data) { return request.post(`/admin/videos/${videoId}/offline`, data) } + +/** 视频基础编辑 { title, description, cover_url, category_id, series_id, episode_no, status } */ +export function updateVideo(videoId, data) { + return request.put(`/admin/videos/${videoId}`, data) +} diff --git a/admin/src/layout/MainLayout.vue b/admin/src/layout/MainLayout.vue index 31aa166..9476e2f 100644 --- a/admin/src/layout/MainLayout.vue +++ b/admin/src/layout/MainLayout.vue @@ -71,6 +71,8 @@ const menuConfig = [ { title: '发布视频', path: '/videos/create', icon: 'Upload', roles: [] }, { title: '视频管理', path: '/videos', icon: 'Film', roles: [] }, { title: '系列管理', path: '/series', icon: 'CollectionTag', roles: [] }, + { title: '分类管理', path: '/categories', icon: 'Menu', roles: [] }, + { title: '标签管理', path: '/tags', icon: 'PriceTag', roles: [] }, { title: '评论管理', path: '/comments', icon: 'ChatDotRound', roles: [] }, { title: '举报处理', path: '/reports', icon: 'Warning', roles: [] }, ], diff --git a/admin/src/router/index.js b/admin/src/router/index.js index 06041fc..491e80b 100644 --- a/admin/src/router/index.js +++ b/admin/src/router/index.js @@ -58,6 +58,18 @@ const routes = [ component: () => import('@/views/SeriesManage.vue'), meta: { title: '系列管理', icon: 'CollectionTag', roles: [] }, }, + { + path: 'categories', + name: 'category-manage', + component: () => import('@/views/CategoryManage.vue'), + meta: { title: '分类管理', icon: 'Menu', roles: [] }, + }, + { + path: 'tags', + name: 'tag-manage', + component: () => import('@/views/TagManage.vue'), + meta: { title: '标签管理', icon: 'PriceTag', roles: [] }, + }, { path: 'comments', name: 'comment-list', diff --git a/admin/src/views/CategoryManage.vue b/admin/src/views/CategoryManage.vue new file mode 100644 index 0000000..c1fea96 --- /dev/null +++ b/admin/src/views/CategoryManage.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/admin/src/views/CreateVideo.vue b/admin/src/views/CreateVideo.vue index 5c0f717..3e48246 100644 --- a/admin/src/views/CreateVideo.vue +++ b/admin/src/views/CreateVideo.vue @@ -140,12 +140,12 @@ const rules = { onMounted(async () => { try { - const res = await request({ url: '/categories', method: 'get' }) - categories.value = res.data || [] + const res = await request({ url: '/admin/categories', method: 'get' }) + categories.value = res || [] } catch (e) {} try { const s = await request({ url: '/admin/series', method: 'get', params: { page_size: 200 } }) - seriesList.value = s.data?.list || [] + seriesList.value = s?.list || [] } catch (e) {} }) @@ -158,8 +158,8 @@ async function uploadFile({ file }) { try { // 1) 先拿上传凭证 const t = await request({ url: '/admin/videos/upload', method: 'post' }) - const token = t.data.token - const uploadUrl = t.data.upload_url + const token = t.token + const uploadUrl = t.upload_url // 2) 上传文件(multipart/form-data,带 token query) const fd = new FormData() fd.append('file', file) @@ -209,7 +209,7 @@ async function submit() { if (form.duration) payload.duration = form.duration } const res = await request({ url: '/admin/videos', method: 'post', data: payload }) - const newVideoId = res.data?.video_id + const newVideoId = res?.video_id resultMsg.value = newVideoId // 如果选了系列 + 集数,绑定进去 if (newVideoId && form.series_id && form.episode_no) { diff --git a/admin/src/views/SeriesManage.vue b/admin/src/views/SeriesManage.vue index 2d221ca..b9a707e 100644 --- a/admin/src/views/SeriesManage.vue +++ b/admin/src/views/SeriesManage.vue @@ -138,7 +138,7 @@ async function uploadCover(file) { url: '/admin/upload/image', method: 'post', data: fd, headers: { 'Content-Type': 'multipart/form-data' }, }) - form.cover_url = r.data.url + form.cover_url = r.url ElMessage.success('封面上传成功') } catch (e) { ElMessage.error(e?.message || '上传失败') @@ -150,8 +150,8 @@ async function uploadCover(file) { onMounted(async () => { load() try { - const r = await request({ url: '/categories', method: 'get' }) - categories.value = r.data || [] + const r = await request({ url: '/admin/categories', method: 'get' }) + categories.value = r || [] } catch (e) {} }) @@ -162,8 +162,8 @@ async function load() { url: '/admin/series', method: 'get', params: { keyword: keyword.value, page: page.value, page_size: pageSize }, }) - list.value = r.data.list - total.value = r.data.total + list.value = r.list + total.value = r.total } catch (e) {} finally { loading.value = false } diff --git a/admin/src/views/TagManage.vue b/admin/src/views/TagManage.vue new file mode 100644 index 0000000..18fbf04 --- /dev/null +++ b/admin/src/views/TagManage.vue @@ -0,0 +1,178 @@ + + + + + diff --git a/admin/src/views/VideoList.vue b/admin/src/views/VideoList.vue index 79b5d12..7ddddc7 100644 --- a/admin/src/views/VideoList.vue +++ b/admin/src/views/VideoList.vue @@ -25,6 +25,9 @@ + + +