This commit is contained in:
lzcode
2026-10-16 16:05:01 +08:00
parent 24d63e6702
commit 9962136fc8
19 changed files with 1425 additions and 208 deletions
+6 -6
View File
@@ -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) {