From 48f84f3ae1c62773b60c4dc1bfe00a4aa6211ac4 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Fri, 26 Apr 2024 05:43:02 -0400 Subject: [PATCH] fix: image key --- frontend/src/pages/index.vue | 2 +- frontend/src/pages/world.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/index.vue b/frontend/src/pages/index.vue index d3bbcf7..8ae045b 100644 --- a/frontend/src/pages/index.vue +++ b/frontend/src/pages/index.vue @@ -286,7 +286,7 @@ export default { // 将images中的baseurl去掉 this.post.images = this.post.images.map(image => { - return image.replace(this.$baseurl.value, '') + return image.replace(this.$baseurl.value + "/v1/post/download-image/", '') }) this.$axios.post('/v1/post/post-new', this.post) diff --git a/frontend/src/pages/world.vue b/frontend/src/pages/world.vue index 7c1cd78..bc13c34 100644 --- a/frontend/src/pages/world.vue +++ b/frontend/src/pages/world.vue @@ -181,7 +181,7 @@ export default { p[i].created_at = date.getUTCFullYear() + "-" + (date.getUTCMonth() + 1) + "-" + date.getUTCDate() + " " + date.getUTCHours() + ":" + date.getUTCMinutes() + ":" + date.getUTCSeconds() p[i].status = this.statusMap[p[i].status] for (let j = 0; j < p[i].images.length; j++) { - p[i].images[j] = this.$baseurl.value + p[i].images[j] + p[i].images[j] = this.$baseurl.value + "/v1/post/download-image/" + p[i].images[j] } } console.log(p) @@ -251,7 +251,7 @@ export default { p[i].created_at = date.getUTCFullYear() + "-" + (date.getUTCMonth() + 1) + "-" + date.getUTCDate() + " " + date.getUTCHours() + ":" + date.getUTCMinutes() + ":" + date.getUTCSeconds() p[i].status = this.statusMap[p[i].status] for (let j = 0; j < p[i].images.length; j++) { - p[i].images[j] = this.$baseurl.value + p[i].images[j] + p[i].images[j] = this.$baseurl.value + "/v1/post/download-image/" + p[i].images[j] } } console.log(p)