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
6b68cfcd
Commit
6b68cfcd
authored
Nov 10, 2026
by
王立鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '线上优化/兼容url' into 'master'
线上优化/兼容url See merge request
!45
parents
c442debf
ddfc662a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
index.vue
src/components/common/ArticleContent/index.vue
+4
-3
index.ts
src/utils/index.ts
+1
-0
oss.ts
src/utils/oss.ts
+15
-0
recommendList.vue
src/views/homePage/homeTab/components/recommendList.vue
+2
-1
No files found.
src/components/common/ArticleContent/index.vue
View file @
6b68cfcd
...
@@ -179,7 +179,7 @@
...
@@ -179,7 +179,7 @@
:src=
"articleDetail.articleVideoUrl"
:src=
"articleDetail.articleVideoUrl"
controls
controls
class=
"w-100%! aspect-video bg-black"
class=
"w-100%! aspect-video bg-black"
:poster=
"
`$
{articleDetail.articleVideoUrl}?x-oss-process=video/snapshot,t_1000,f_jpg`
"
:poster=
"
getVideoPosterUrl(articleDetail.articleVideoUrl)
"
/>
/>
</div>
</div>
<!-- 文章内容 -->
<!-- 文章内容 -->
...
@@ -214,7 +214,7 @@
...
@@ -214,7 +214,7 @@
:src=
"articleDetail.videoUrl"
:src=
"articleDetail.videoUrl"
controls
controls
class=
"w-100%! aspect-video bg-black"
class=
"w-100%! aspect-video bg-black"
:poster=
"
`${articleDetail.videoUrl}?x-oss-process=video/snapshot,t_1000,f_jpg`
"
:poster=
"
getVideoPosterUrl(articleDetail.videoUrl)
"
/>
/>
</div>
</div>
</div>
</div>
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
:src=
"articleDetail.articleVideoUrl"
:src=
"articleDetail.articleVideoUrl"
controls
controls
class=
"w-100%! aspect-video bg-black"
class=
"w-100%! aspect-video bg-black"
:poster=
"
`${articleDetail.articleVideoUrl}?x-oss-process=video/snapshot,t_1000,f_jpg`
"
:poster=
"
getVideoPosterUrl(articleDetail.articleVideoUrl)
"
/>
/>
</div>
</div>
<!-- 标签 -->
<!-- 标签 -->
...
@@ -294,6 +294,7 @@
...
@@ -294,6 +294,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
import
{
getVideoPosterUrl
}
from
'@/utils'
import
{
getRelatedColumnList
,
type
ArticleItemDto
,
type
RelatedColumnItemDto
}
from
'@/api'
import
{
getRelatedColumnList
,
type
ArticleItemDto
,
type
RelatedColumnItemDto
}
from
'@/api'
import
{
articleTypeListOptions
,
ArticleTypeEnum
,
VideoPositionEnum
}
from
'@/constants'
import
{
articleTypeListOptions
,
ArticleTypeEnum
,
VideoPositionEnum
}
from
'@/constants'
import
ActionMore
from
'@/components/common/ActionMore/index.vue'
import
ActionMore
from
'@/components/common/ActionMore/index.vue'
...
...
src/utils/index.ts
View file @
6b68cfcd
export
*
from
'./app'
export
*
from
'./app'
export
*
from
'./wxUtil'
export
*
from
'./wxUtil'
export
*
from
'./excel'
export
*
from
'./excel'
export
*
from
'./oss'
src/utils/oss.ts
0 → 100644
View file @
6b68cfcd
/**
* 给文件 URL 拼接 OSS 处理参数。
* 后端返回的 URL 可能已带 query(如 ?expires=...&sign=...),
* 此时必须用 & 连接,否则会出现双 ? 导致资源加载失败。
*/
export
const
withOssProcess
=
(
url
:
string
,
process
:
string
)
=>
{
if
(
!
url
)
return
url
return
`
${
url
}${
url
.
includes
(
'?'
)
?
'&'
:
'?'
}
x-oss-process=
${
process
}
`
}
/** 图片转 webp */
export
const
toWebpUrl
=
(
url
:
string
)
=>
withOssProcess
(
url
,
'image/format,webp'
)
/** 视频第 1 秒截帧作为封面 */
export
const
getVideoPosterUrl
=
(
url
:
string
)
=>
withOssProcess
(
url
,
'video/snapshot,t_1000,f_jpg'
)
src/views/homePage/homeTab/components/recommendList.vue
View file @
6b68cfcd
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
<div
v-show=
"item.faceUrl"
class=
"relative flex-shrink-0 w-30 h-20 xl:w-36 xl:h-24"
>
<div
v-show=
"item.faceUrl"
class=
"relative flex-shrink-0 w-30 h-20 xl:w-36 xl:h-24"
>
<el-image
<el-image
:src=
"
item.faceUrl + '?x-oss-process=image/format,webp'
"
:src=
"
toWebpUrl(item.faceUrl)
"
alt=
"文章配图"
alt=
"文章配图"
fit=
"cover"
fit=
"cover"
:lazy=
"true"
:lazy=
"true"
...
@@ -136,6 +136,7 @@ import { TABS_REF_KEY, ArticleTypeEnum } from '@/constants'
...
@@ -136,6 +136,7 @@ import { TABS_REF_KEY, ArticleTypeEnum } from '@/constants'
import
{
useScrollTop
,
useNavigation
}
from
'@/hooks'
import
{
useScrollTop
,
useNavigation
}
from
'@/hooks'
import
{
articleTypeListOptions
}
from
'@/constants'
import
{
articleTypeListOptions
}
from
'@/constants'
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
import
{
toWebpUrl
}
from
'@/utils'
const
{
list
,
total
,
searchParams
,
loading
,
goToPage
,
changePageSize
,
refresh
}
=
usePageSearch
(
const
{
list
,
total
,
searchParams
,
loading
,
goToPage
,
changePageSize
,
refresh
}
=
usePageSearch
(
getArticleList
,
getArticleList
,
...
...
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