Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
3b22a7b0
Commit
3b22a7b0
authored
Apr 20, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化 11018】 perf: 优化转本地blob
parent
9164531a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
index.vue
src/views/publishVideo/index.vue
+7
-11
No files found.
src/views/publishVideo/index.vue
View file @
3b22a7b0
...
...
@@ -292,11 +292,12 @@
width=
"800px"
:close-on-click-modal=
"false"
>
<!--
这个用blob是因为 转为canvas 防止跨域污染
-->
<!--
转为canvas 防止跨域污染 crossorigin="anonymous"
-->
<div
v-if=
"locationVideoBlolUrl"
class=
"space-y-6"
>
<!-- 视频预览 -->
<div
class=
"relative"
>
<video
crossorigin=
"anonymous"
ref=
"videoRef"
:src=
"locationVideoBlolUrl"
class=
"w-full max-h-96 rounded-lg bg-black"
...
...
@@ -372,7 +373,7 @@ import SelectTags from '@/components/common/SelectTags/index.vue'
import
type
{
TagItemDto
,
AddOrUpdateVideoDto
}
from
'@/api'
import
{
useVideoStore
,
useUserStore
}
from
'@/stores'
import
{
storeToRefs
}
from
'pinia'
import
{
selectDepOrUser
,
fetchOssBlob
}
from
'@/utils'
import
{
selectDepOrUser
}
from
'@/utils'
import
BackButton
from
'@/components/common/BackButton/index.vue'
import
{
push
}
from
'notivue'
...
...
@@ -610,19 +611,13 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => {
}
const
handleVideoChange
=
({
file
,
videoDuration
,
}:
{
file
:
File
url
:
string
videoDuration
:
string
})
=>
{
if
(
locationVideoBlolUrl
.
value
)
{
URL
.
revokeObjectURL
(
locationVideoBlolUrl
.
value
)
}
if
(
file
)
{
locationVideoBlolUrl
.
value
=
URL
.
createObjectURL
(
file
)
}
locationVideoBlolUrl
.
value
=
form
.
value
.
videoUrl
form
.
value
.
videoDuration
=
videoDuration
}
...
...
@@ -645,8 +640,9 @@ onDeactivated(() => {
onActivated
(
async
()
=>
{
if
(
route
.
query
.
id
)
{
const
{
data
}
=
await
getArticleDetail
(
route
.
query
.
id
as
string
)
const
blobUrl
=
await
fetchOssBlob
(
data
.
videoUrl
)
locationVideoBlolUrl
.
value
=
blobUrl
locationVideoBlolUrl
.
value
=
data
.
videoUrl
form
.
value
=
{
...
form
.
value
,
...
data
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment