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 {