From f57b7cb2ae6b9bb73be44cedb8c4a90f2dbeedfc Mon Sep 17 00:00:00 2001 From: zhcnyuyang Date: Sun, 24 Aug 2025 10:47:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=B8=83=E5=B1=80=E8=B7=B3?= =?UTF-8?q?=E5=8A=A8=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BB=A5=E5=8F=8A=E5=AA=92?= =?UTF-8?q?=E4=BD=93=E6=96=87=E4=BB=B6=E5=85=A8=E9=9D=A2=E8=BD=AC=E7=A7=BB?= =?UTF-8?q?=E5=88=B0CDN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/uploadAssets2volOSS.ts | 5 ++++- src/components/ExampleItem.vue | 15 ++++++++------- src/components/ExamplesContent.vue | 2 +- src/main.js | 1 + 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/uploadAssets2volOSS.ts b/scripts/uploadAssets2volOSS.ts index 5c56ed1..2f424b5 100644 --- a/scripts/uploadAssets2volOSS.ts +++ b/scripts/uploadAssets2volOSS.ts @@ -74,7 +74,10 @@ async function getAllFiles(dirPath: string, fileList: string[] = []): Promise { try { // 计算相对路径作为对象键名 - const key = filePath.replace(basePath, '').replace(/^\//, ''); + let key = filePath.replace(basePath, '').replace(/^[\/\\]/, ''); + // 将Windows路径分隔符转换为正斜杠 + key = key.replace(/\\/g, '/'); + const contentType = getContentType(filePath); const fileContent = fs.readFileSync(filePath); diff --git a/src/components/ExampleItem.vue b/src/components/ExampleItem.vue index 193f074..08ce3c4 100644 --- a/src/components/ExampleItem.vue +++ b/src/components/ExampleItem.vue @@ -9,7 +9,8 @@ export default { psginfo:null, error:null, isLoading: false, - cmsroot: '${this.$axios.defaults.baseURL}' + // cmsroot: '${this.$axios.defaults.baseURL}' + cmsroot: 'https://cdn.kdesign.top' } }, setup() { @@ -75,9 +76,9 @@ export default {