Compare commits
No commits in common. "bacb60fb439205295d7da9c15756f1f1647d5a56" and "b4869ac00500438f43dc58675f8f98121589dddb" have entirely different histories.
bacb60fb43
...
b4869ac005
@ -8,7 +8,6 @@
|
|||||||
import { TosClient } from '@volcengine/tos-sdk';
|
import { TosClient } from '@volcengine/tos-sdk';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
|
||||||
|
|
||||||
|
|
||||||
// 配置信息
|
// 配置信息
|
||||||
@ -98,15 +97,15 @@ async function uploadDirectory(dirPath: string): Promise<void> {
|
|||||||
try {
|
try {
|
||||||
const basePath = path.resolve(dirPath, '..');
|
const basePath = path.resolve(dirPath, '..');
|
||||||
const allFiles = await getAllFiles(dirPath);
|
const allFiles = await getAllFiles(dirPath);
|
||||||
|
|
||||||
console.log(`找到 ${allFiles.length} 个文件需要上传`);
|
console.log(`找到 ${allFiles.length} 个文件需要上传`);
|
||||||
|
|
||||||
// 创建上传任务队列
|
// 创建上传任务队列
|
||||||
const uploadTasks = allFiles.map(filePath => uploadFile(filePath, basePath));
|
const uploadTasks = allFiles.map(filePath => uploadFile(filePath, basePath));
|
||||||
|
|
||||||
// 并发上传文件
|
// 并发上传文件
|
||||||
await Promise.all(uploadTasks);
|
await Promise.all(uploadTasks);
|
||||||
|
|
||||||
console.log('所有文件上传完成');
|
console.log('所有文件上传完成');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('上传目录失败:', error);
|
console.error('上传目录失败:', error);
|
||||||
@ -115,10 +114,11 @@ async function uploadDirectory(dirPath: string): Promise<void> {
|
|||||||
|
|
||||||
// 主函数
|
// 主函数
|
||||||
async function main() {
|
async function main() {
|
||||||
// ES 模块中获取当前文件目录的正确方式
|
// 使用 import.meta.url 替代 __dirname (ES 模块兼容)
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const currentFileUrl = import.meta.url;
|
||||||
const __dirname = path.dirname(__filename);
|
const currentFilePath = new URL(currentFileUrl).pathname;
|
||||||
const assetsDir = path.resolve(__dirname, '../dist/assets');
|
const currentDir = path.dirname(currentFilePath);
|
||||||
|
const assetsDir = path.resolve(currentDir, '../dist/assets');
|
||||||
console.log(`开始上传目录: ${assetsDir}`);
|
console.log(`开始上传目录: ${assetsDir}`);
|
||||||
await uploadDirectory(assetsDir);
|
await uploadDirectory(assetsDir);
|
||||||
}
|
}
|
||||||
@ -128,3 +128,4 @@ main().catch(error => {
|
|||||||
console.error('程序执行失败:', error);
|
console.error('程序执行失败:', error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ const { breakpoint } = useBootstrapBreakpoint();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="pageroot" id="serviceprocessroot">
|
<div class="pageroot" id="serviceprocessroot">
|
||||||
<div id="serviceprocessbanner">
|
<div id="serviceprocessbanner" class="videorootbanner">
|
||||||
<img class="videoimg" :src="Newbanner"/>
|
<img class="videoimg" :src="Newbanner"/>
|
||||||
<div id="expbanner" class="bannerovervideo">
|
<div id="expbanner" class="bannerovervideo">
|
||||||
<div class="bannercontent">
|
<div class="bannercontent">
|
||||||
@ -131,12 +131,6 @@ export default {
|
|||||||
@import "src/publicstyle.scss";
|
@import "src/publicstyle.scss";
|
||||||
|
|
||||||
#serviceprocessbanner{
|
#serviceprocessbanner{
|
||||||
width: 100% !important;
|
|
||||||
background-color: black !important;
|
|
||||||
position: relative !important;
|
|
||||||
z-index: 0 !important;
|
|
||||||
overflow: hidden !important;
|
|
||||||
|
|
||||||
@include media-breakpoint-between(xs, md) {
|
@include media-breakpoint-between(xs, md) {
|
||||||
aspect-ratio: 1.92;
|
aspect-ratio: 1.92;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,41 +35,41 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.videorootbanner{
|
.videorootbanner{
|
||||||
width: 100% !important;
|
width: 100%;
|
||||||
background-color: black !important;
|
background-color: black;
|
||||||
position: relative !important;
|
position: relative;
|
||||||
z-index: 0 !important;
|
z-index: 0;
|
||||||
overflow: hidden !important;
|
overflow: hidden;
|
||||||
|
|
||||||
// 始终保持固定的aspect-ratio作为占位,确保立即渲染
|
// 始终保持固定的aspect-ratio作为占位,确保立即渲染
|
||||||
@include media-breakpoint-between(xs, md) {
|
@include media-breakpoint-between(xs, md) {
|
||||||
aspect-ratio: 1.92 !important;
|
aspect-ratio: 1.92;
|
||||||
}
|
}
|
||||||
@include media-breakpoint-up(md){
|
@include media-breakpoint-up(md){
|
||||||
aspect-ratio: 2.62026969 !important;
|
aspect-ratio: 2.62026969;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 视频/图片元素的默认样式
|
// 视频/图片元素的默认样式
|
||||||
video, .videoimg {
|
video, .videoimg {
|
||||||
position: absolute !important;
|
position: absolute;
|
||||||
top: 0 !important;
|
top: 0;
|
||||||
left: 0 !important;
|
left: 0;
|
||||||
width: 100% !important;
|
width: 100%;
|
||||||
height: 100% !important;
|
height: 100%;
|
||||||
object-fit: cover !important;
|
object-fit: cover;
|
||||||
display: block !important;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当媒体加载完成后,重新调整容器和媒体尺寸
|
// 当媒体加载完成后,重新调整容器和媒体尺寸
|
||||||
&.video-loaded {
|
&.video-loaded {
|
||||||
aspect-ratio: unset !important; // 移除固定比例
|
aspect-ratio: unset; // 移除固定比例
|
||||||
height: auto !important; // 高度自适应
|
height: auto; // 高度自适应
|
||||||
|
|
||||||
video, .videoimg {
|
video, .videoimg {
|
||||||
position: static !important; // 改为文档流布局
|
position: static; // 改为文档流布局
|
||||||
width: 100% !important; // 宽度占满
|
width: 100%; // 宽度占满
|
||||||
height: auto !important; // 高度自适应
|
height: auto; // 高度自适应
|
||||||
object-fit: contain !important; // 保持媒体比例,完整显示
|
object-fit: contain; // 保持媒体比例,完整显示
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,8 +4,7 @@ import { fileURLToPath, URL } from 'node:url'
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
// base: process.env.NODE_ENV === 'production' ? 'https://cdn.kdesign.top/' : '/',
|
base: process.env.NODE_ENV === 'production' ? 'https://cdn.kdesign.top/' : '/',
|
||||||
base: '/',
|
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
// 添加自定义中间件来处理根路径
|
// 添加自定义中间件来处理根路径
|
||||||
@ -38,11 +37,6 @@ export default defineConfig({
|
|||||||
input: {
|
input: {
|
||||||
main: fileURLToPath(new URL('./index.html', import.meta.url)),
|
main: fileURLToPath(new URL('./index.html', import.meta.url)),
|
||||||
start: fileURLToPath(new URL('./start.html', import.meta.url))
|
start: fileURLToPath(new URL('./start.html', import.meta.url))
|
||||||
},
|
|
||||||
output: {
|
|
||||||
chunkFileNames: 'assets/[name]-[hash].js',
|
|
||||||
entryFileNames: 'assets/[name]-[hash].js',
|
|
||||||
assetFileNames: 'assets/[name]-[hash].[ext]'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user