From 572c4cee1bc1cec69fe669115d16c0bb5fee219a Mon Sep 17 00:00:00 2001 From: zhx Date: Wed, 8 Jul 2026 19:46:39 +0800 Subject: [PATCH] fix: switch h5 assets to global interaction cos --- docs/视频特效播放说明.md | 5 ++--- docs/项目详情.md | 4 ++-- src/components/itemCenter.vue | 2 +- src/config/imagePaths.js | 4 +++- src/utils/image/imageCacheManager.js | 5 +++-- .../DailyRecharge/composables/useDailyRechargeRewardVap.js | 3 ++- vite.config.js | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/视频特效播放说明.md b/docs/视频特效播放说明.md index 5f97ea6..21cce5c 100644 --- a/docs/视频特效播放说明.md +++ b/docs/视频特效播放说明.md @@ -119,7 +119,7 @@ const bgVapUrl = mp4Url('bg') 生成的线上地址形如: ```text -https://cdn.azizichat.com/h5/Azizi/Activities/ActiveGame/bg.mp4 +https://asset.global-interaction.com/h5/Azizi/Activities/ActiveGame/bg.mp4 ``` 开发环境会走: @@ -199,7 +199,7 @@ await preloadVapConfig(resolveProtectedAssetUrl(bgVapUrl)) ```js const rewardVapUrl = - 'https://cdn.azizichat.com/svgasource/manager-d824e59b-1a88-4d4f-aed3-01768ba20542.mp4' + 'https://asset.global-interaction.com/svgasource/manager-d824e59b-1a88-4d4f-aed3-01768ba20542.mp4' ``` ## 预加载建议 @@ -283,4 +283,3 @@ await Promise.all([ - inline 不显示:确认父容器有 `position: relative/absolute` 和明确宽高。 - overlay 被遮挡:检查是否有更高的 z-index;默认播放器弹层是 `3000`。 - 背景遮挡内容:检查页面层级,ActiveGame 当前是页面背景 `z-index: 0`、VAP 背景 `z-index: 1`、页面内容 `z-index: 2`。 - diff --git a/docs/项目详情.md b/docs/项目详情.md index 64f5be0..ee86709 100644 --- a/docs/项目详情.md +++ b/docs/项目详情.md @@ -145,7 +145,7 @@ npm run docs:sync:security - host: `0.0.0.0` - port: `5173` - strictPort: `true` - - `/oss` 代理到 `https://cdn.azizichat.com` + - `/oss` 代理到 `https://asset.global-interaction.com` - 预览服务: - host: `0.0.0.0` - port: `4173` @@ -520,7 +520,7 @@ Pinia 启用了 persisted state。 规则: - 开发环境:`/oss/h5/Azizi/` -- 非开发环境:`https://cdn.azizichat.com/h5/Azizi/` +- 非开发环境:`https://asset.global-interaction.com/h5/Azizi/` 常用方法: diff --git a/src/components/itemCenter.vue b/src/components/itemCenter.vue index 17ba47a..2ca7629 100644 --- a/src/components/itemCenter.vue +++ b/src/components/itemCenter.vue @@ -102,7 +102,7 @@ const shouldShowImage = computed(() => { // const isOSSImage = computed(() => { // return ( // props.imgUrl.startsWith('/oss/h5/Azizi/') || -// props.imgUrl.startsWith('https://cdn.azizichat.com/h5/Azizi/') +// props.imgUrl.startsWith('https://asset.global-interaction.com/h5/Azizi/') // ) // }) diff --git a/src/config/imagePaths.js b/src/config/imagePaths.js index fc8264f..0c9f9c1 100644 --- a/src/config/imagePaths.js +++ b/src/config/imagePaths.js @@ -1,7 +1,9 @@ import { protectAssetUrl } from '@/utils/protectedAssets.js' +export const OSS_REMOTE_BASE_URL = 'https://asset.global-interaction.com/h5/Azizi/' + export const OSS_BASE_URL = - process.env.NODE_ENV === 'development' ? '/oss/h5/Azizi/' : 'https://cdn.azizichat.com/h5/Azizi/' + process.env.NODE_ENV === 'development' ? '/oss/h5/Azizi/' : OSS_REMOTE_BASE_URL function buildAssetUrl(imagePath, filename, extension) { return `${OSS_BASE_URL}${imagePath}${filename}.${extension}` diff --git a/src/utils/image/imageCacheManager.js b/src/utils/image/imageCacheManager.js index 42beb35..6ea17cc 100644 --- a/src/utils/image/imageCacheManager.js +++ b/src/utils/image/imageCacheManager.js @@ -1,5 +1,6 @@ // src/utils/imageCacheManager.js import { IMAGE_CACHE_VERSION } from '@/config/imageCacheVersion' +import { OSS_REMOTE_BASE_URL } from '@/config/imagePaths.js' import { resolveProtectedAssetUrl } from '@/utils/protectedAssets.js' import { useDebounce } from '@/utils/useDebounce' @@ -61,7 +62,7 @@ class ImageCacheManager { let cacheName if ( - normalizedUrl.startsWith('https://cdn.azizichat.com/h5/Azizi/') || + normalizedUrl.startsWith(OSS_REMOTE_BASE_URL) || normalizedUrl.includes('/oss/h5/Azizi/') ) { cacheName = this.imageCacheName @@ -309,7 +310,7 @@ class ImageCacheManager { const containsAssets = normalizedUrl.includes('/assets/') const containsOssH5 = normalizedUrl.includes('/oss/h5/Azizi/') - const startsWithOss = normalizedUrl.startsWith('https://cdn.azizichat.com/h5/Azizi/') + const startsWithOss = normalizedUrl.startsWith(OSS_REMOTE_BASE_URL) // 只缓存三种类型的资源 return containsAssets || containsOssH5 || startsWithOss diff --git a/src/views/Activities/DailyRecharge/composables/useDailyRechargeRewardVap.js b/src/views/Activities/DailyRecharge/composables/useDailyRechargeRewardVap.js index 8e3268c..13d49cc 100644 --- a/src/views/Activities/DailyRecharge/composables/useDailyRechargeRewardVap.js +++ b/src/views/Activities/DailyRecharge/composables/useDailyRechargeRewardVap.js @@ -3,6 +3,7 @@ import { clearVapConfigCache, preloadVapConfig } from '@/utils/vapMp4Config.js' import { resolveProtectedAssetUrl } from '@/utils/protectedAssets.js' const REWARD_VAP_MAX_RETRY_COUNT = 3 +const ASSET_ORIGIN = 'https://asset.global-interaction.com' const isEmptySourceValue = (value) => { if (typeof value !== 'string' && typeof value !== 'number') { @@ -77,7 +78,7 @@ export function useDailyRechargeRewardVap(options = {}) { if (resolvedUrl.startsWith('/')) { return process.env.NODE_ENV === 'development' ? `/oss${resolvedUrl}` - : `https://cdn.azizichat.com${resolvedUrl}` + : `${ASSET_ORIGIN}${resolvedUrl}` } return `https://${resolvedUrl}` diff --git a/vite.config.js b/vite.config.js index ecbe168..b4d694f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -365,7 +365,7 @@ export default defineConfig(({ mode }) => { cors: true, proxy: { '/oss': { - target: 'https://cdn.azizichat.com', + target: 'https://asset.global-interaction.com', changeOrigin: true, secure: true, rewrite: (path) => path.replace(/^\/oss/, ''),