Compare commits

...

2 Commits

Author SHA1 Message Date
Volankey
74d299a8c3 feat: 更新资源引用方式&构建上传 tos 2025-08-17 18:43:13 +08:00
Volankey
613bd00f10 chore: 资源位置移动 2025-08-17 18:42:42 +08:00
253 changed files with 2075 additions and 164 deletions

1737
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,15 @@
"name": "kdoffical",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"upload-assets": "esno scripts/uploadAssets2volOSS.ts"
},
"dependencies": {
"@volcengine/tos-sdk": "^2.7.5",
"axios": "^1.6.8",
"bootstrap": "^5.3.3",
"bootstrap-icons": "latest",
@ -20,6 +23,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.0.0",
"esno": "^4.8.0",
"vite": "^4.0.0"
}
}

View File

@ -0,0 +1,131 @@
// Access Key ID Secret Access Key
// AKLTZDY5ZjE0ZjMxODdiNDhjODkyYzhkODY2MmUwYmZlMzc TjJaak5XVTBOR0ZtTTJRek5HWTRPRGhoT0RBellXUTNORFV3WmpOa1pERQ==
// S3 endpointtos-cn-beijing.volces.com
// 外网访问tos-s3-cn-beijing.volces.com
// Bucket 域名kdesign-offical.tos-cn-beijing.volces.com
import { TosClient } from '@volcengine/tos-sdk';
import * as fs from 'fs';
import * as path from 'path';
// 配置信息
const config = {
accessKeyId: 'AKLTZDY5ZjE0ZjMxODdiNDhjODkyYzhkODY2MmUwYmZlMzc',
secretAccessKey: 'TjJaak5XVTBOR0ZtTTJRek5HWTRPRGhoT0RBellXUTNORFV3WmpOa1pERQ==',
endpoint: 'tos-cn-beijing.volces.com',
region: 'cn-beijing',
bucket: 'kdesign-offical'
};
// 创建 TOS 客户端
const client = new TosClient({
accessKeyId: config.accessKeyId,
accessKeySecret: config.secretAccessKey,
endpoint: config.endpoint,
region: config.region
});
// 获取文件的 Content-Type
function getContentType(filePath: string): string {
const ext = path.extname(filePath).toLowerCase();
const contentTypeMap: Record<string, string> = {
'.html': 'text/html',
'.css': 'text/css',
'.js': 'application/javascript',
'.json': 'application/json',
'.png': 'image/png',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
'.svg': 'image/svg+xml',
'.mp4': 'video/mp4',
'.webp': 'image/webp',
'.ico': 'image/x-icon',
'.txt': 'text/plain',
'.pdf': 'application/pdf',
'.zip': 'application/zip'
};
return contentTypeMap[ext] || 'application/octet-stream';
}
// 递归获取目录下所有文件
async function getAllFiles(dirPath: string, fileList: string[] = []): Promise<string[]> {
const files = fs.readdirSync(dirPath);
for (const file of files) {
const filePath = path.join(dirPath, file);
const stat = fs.statSync(filePath);
if (stat.isDirectory()) {
await getAllFiles(filePath, fileList);
} else {
fileList.push(filePath);
}
}
return fileList;
}
// 上传单个文件
async function uploadFile(filePath: string, basePath: string): Promise<void> {
try {
// 计算相对路径作为对象键名
const key = filePath.replace(basePath, '').replace(/^\//, '');
const contentType = getContentType(filePath);
const fileContent = fs.readFileSync(filePath);
console.log(`上传文件: ${filePath} -> ${key}`);
const response = await client.putObject({
bucket: config.bucket,
key: key,
body: fileContent,
contentType: contentType
});
console.log(`上传成功: ${key}, 请求ID: ${response.requestId}`);
} catch (error) {
console.error(`上传文件 ${filePath} 失败:`, error);
}
}
// 上传目录下所有文件
async function uploadDirectory(dirPath: string): Promise<void> {
try {
const basePath = path.resolve(dirPath, '..');
const allFiles = await getAllFiles(dirPath);
console.log(`找到 ${allFiles.length} 个文件需要上传`);
// 创建上传任务队列
const uploadTasks = allFiles.map(filePath => uploadFile(filePath, basePath));
// 并发上传文件
await Promise.all(uploadTasks);
console.log('所有文件上传完成');
} catch (error) {
console.error('上传目录失败:', error);
}
}
// 主函数
async function main() {
// 使用 import.meta.url 替代 __dirname (ES 模块兼容)
const currentFileUrl = import.meta.url;
const currentFilePath = new URL(currentFileUrl).pathname;
const currentDir = path.dirname(currentFilePath);
const assetsDir = path.resolve(currentDir, '../dist/assets');
console.log(`开始上传目录: ${assetsDir}`);
await uploadDirectory(assetsDir);
}
// 执行主函数
main().catch(error => {
console.error('程序执行失败:', error);
process.exit(1);
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

BIN
src/assets/AboutusVideo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

BIN
src/assets/AboutusVideo.mp4 Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

BIN
src/assets/ExpVideo.mp4 Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="236px" height="42px" viewBox="0 0 236 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>形状结合@1x</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="首页" transform="translate(-257, -1263)" fill="#000000" fill-rule="nonzero">
<g id="编组-2" transform="translate(256, 1263)">
<path d="M34.6901013,41.6519337 L19.8921922,16.7651934 L33.6957754,0.348066298 L23.8110061,0.348066298 L9.13007654,18.3314917 L9.13007654,0.348066298 L1,0.348066298 L1,41.6519337 L9.13007654,41.6519337 L9.13007654,29.2375691 L14.5111344,22.8563536 L25.2147603,41.6519337 L34.6901013,41.6519337 Z M80.3265075,20.5359116 C80.3265075,14.7928177 80.5604666,8.46961326 76.2322244,4.17679558 C73.7171648,1.68232044 70.0323099,0.348066298 65.7040677,0.348066298 L51.4325665,0.348066298 L51.4325665,41.6519337 L65.7040677,41.6519337 C70.0323099,41.6519337 73.7171648,40.3176796 76.2322244,37.8232044 C80.5604666,33.5303867 80.3265075,26.2790055 80.3265075,20.5359116 Z M75.8812858,20.5359116 C75.8812858,25.5828729 75.9982654,31.7320442 73.1322672,34.6906077 C70.9681461,36.8950276 68.1606376,37.7071823 64.9437009,37.7071823 L55.8777882,37.7071823 L55.8777882,4.29281768 L64.9437009,4.29281768 C68.1606376,4.29281768 70.9681461,5.10497238 73.1322672,7.30939227 C75.9982654,10.2679558 75.8812858,15.4889503 75.8812858,20.5359116 Z M114.820843,41.6519337 L114.820843,37.7071823 L93.4135912,37.7071823 L93.4135912,22.7983425 L111.662396,22.7983425 L111.662396,18.8535912 L93.4135912,18.8535912 L93.4135912,4.29281768 L114.820843,4.29281768 L114.820843,0.348066298 L88.9683695,0.348066298 L88.9683695,41.6519337 L114.820843,41.6519337 Z M147.326527,30.281768 C147.326527,26.859116 146.098242,24.0165746 143.817141,22.1022099 C142.062448,20.5939227 140.132286,19.781768 136.213473,19.2016575 L131.651271,18.5055249 C129.48715,18.1574586 127.323029,17.3453039 126.036254,16.2430939 C124.74948,15.140884 124.164582,13.5165746 124.164582,11.4861878 C124.164582,6.90331492 127.381519,3.82872928 132.938046,3.82872928 C137.324778,3.82872928 140.073797,5.04696133 142.647346,7.36740331 L145.513344,4.52486188 C141.945469,1.33425414 138.436083,0 133.113515,0 C124.866459,0 119.77785,4.64088398 119.77785,11.660221 C119.77785,14.9668508 120.830666,17.519337 122.936297,19.3756906 C124.74948,20.941989 127.323029,21.9861878 130.598456,22.5082873 L135.453106,23.2624309 C138.494573,23.7265193 139.547389,24.0745856 140.892653,25.2348066 C142.237918,26.3950276 142.881305,28.2513812 142.881305,30.3977901 C142.881305,35.2127072 139.137961,38.0552486 133.055026,38.0552486 C128.375845,38.0552486 125.158908,36.9530387 121.708012,33.5303867 L118.666545,36.5469613 C122.585359,40.4337017 126.679642,42 132.938046,42 C141.59453,42 147.326527,37.5331492 147.326527,30.281768 Z M159.243815,41.6519337 L159.243815,0.348066298 L154.798594,0.348066298 L154.798594,41.6519337 L159.243815,41.6519337 Z M197.130557,26.5690608 L197.130557,20.0138122 L182.449627,20.0138122 L182.449627,23.9005525 L192.685335,23.9005525 L192.685335,27.0331492 C192.685335,30.2237569 192.041948,32.4861878 190.345745,34.5165746 C188.415583,36.8370166 185.491095,38.0552486 182.449627,38.0552486 C179.700609,38.0552486 177.068569,37.0110497 175.255387,35.1546961 C172.623348,32.4861878 172.330899,29.6436464 172.330899,21 C172.330899,12.3563536 172.623348,9.5718232 175.255387,6.90331492 C177.068569,5.04696133 179.700609,3.94475138 182.449627,3.94475138 C187.655216,3.94475138 191.39856,7.13535912 192.568356,12.3563536 L197.013577,12.3563536 C195.785292,5.10497238 190.404235,0 182.449627,0 C178.296854,0 174.612,1.50828729 171.804491,4.29281768 C167.885677,8.17955801 167.885677,12.2403315 167.885677,21 C167.885677,29.7596685 167.885677,33.820442 171.804491,37.7071823 C174.612,40.4917127 178.355344,42 182.449627,42 C186.71938,42 190.638194,40.3756906 193.562682,37.2430939 C196.136231,34.5165746 197.130557,31.3259669 197.130557,26.5690608 Z M236.421053,41.6519337 L236.421053,0.348066298 L231.975831,0.348066298 L231.975831,33.3563536 L209.866702,0.348066298 L205.655439,0.348066298 L205.655439,41.6519337 L210.100661,41.6519337 L210.100661,8.52762431 L232.20979,41.6519337 L236.421053,41.6519337 Z" id="形状结合"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
src/assets/HpgVideo.mp4 Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
src/assets/bottom/bg_pc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

4
src/assets/cropped.svg Normal file
View File

@ -0,0 +1,4 @@
<svg t="1747713640497" class="icon" viewBox="1.0666729035156095 60.53332519531251 200.0000244140625 83.1999755859375" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4994" xmlns:xlink="http://www.w3.org/1999/xlink" width="200.0000244140625" height="83.1999755859375">
<path d="M6.71115421 489.90890885l662.73273745-1e-8L669.44389165 551.27305136 6.71115421 551.27305136l2e-8-61.36414251z" fill="#d81e06" p-id="4995"></path>
<path d="M665.71307852 306.28092891L1022.56779958 515.86227332l-356.85472106 215.24570478 0-424.82704919z" fill="#d81e06" p-id="4996"></path>
</svg>

After

Width:  |  Height:  |  Size: 587 B

BIN
src/assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
src/assets/iFavicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg t="1747735707334" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9006" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
<path d="M512 64c247.424 0 448 200.576 448 448S759.424 960 512 960 64 759.424 64 512 264.576 64 512 64z m0 68c-209.868 0-380 170.132-380 380s170.132 380 380 380 380-170.132 380-380-170.132-380-380-380z m-48.516 212.181l0.435 0.29 0.435 0.3L664.38 484.828c9.168 6.42 13.94 16.775 13.635 27.183 0.301 10.245-4.318 20.438-13.204 26.877l-0.43 0.307-200.026 140.059c-14.477 10.137-34.43 6.618-44.567-7.859-10.035-14.332-6.687-34.032 7.428-44.26l0.43-0.307 163.976-114.817-163.975-114.816c-14.477-10.137-17.996-30.09-7.859-44.567 9.935-14.19 29.3-17.851 43.697-8.448z" fill="#ffffff" p-id="9007"></path>
</svg>

After

Width:  |  Height:  |  Size: 936 B

BIN
src/assets/logobeginPC.mp4 Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
src/assets/openvideo/00.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
src/assets/openvideo/01.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
src/assets/openvideo/02.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
src/assets/openvideo/03.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
src/assets/openvideo/04.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/openvideo/05.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/openvideo/06.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/openvideo/07.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/openvideo/08.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/openvideo/09.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/assets/openvideo/10.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/assets/openvideo/11.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/assets/openvideo/12.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
src/assets/openvideo/13.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/openvideo/14.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/openvideo/15.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/assets/openvideo/16.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/openvideo/17.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/openvideo/18.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/assets/openvideo/19.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
src/assets/openvideo/20.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
src/assets/openvideo/21.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
src/assets/openvideo/22.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
src/assets/openvideo/23.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
src/assets/openvideo/24.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
src/assets/openvideo/25.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
src/assets/openvideo/26.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
src/assets/openvideo/27.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/assets/openvideo/28.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/assets/openvideo/29.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/openvideo/30.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/openvideo/31.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/openvideo/32.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/openvideo/33.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/openvideo/34.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/openvideo/35.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/openvideo/36.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/openvideo/37.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Some files were not shown because too many files have changed in this diff Show More