From 5a1ef55126676d4de673fa8b4a3c5e616d3ed82e Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 30 Mar 2024 00:57:16 +0800 Subject: [PATCH] :bug: Bug fixes :sparkles: Collapsable sidebar --- package.json | 1 + src/components/publish/PostTools.vue | 6 ++-- src/components/publish/parts/Media.vue | 10 +++--- src/layouts/master.vue | 44 ++++++++++++++++++-------- vite.config.ts | 17 +++++++++- 5 files changed, 54 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index b148700..817c96f 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "typescript": "~5.4.0", "unocss": "^0.58.7", "vite": "^5.1.6", + "vite-plugin-pwa": "^0.19.7", "vue-tsc": "^2.0.6" } } diff --git a/src/components/publish/PostTools.vue b/src/components/publish/PostTools.vue index 2c1f4ef..df1e582 100644 --- a/src/components/publish/PostTools.vue +++ b/src/components/publish/PostTools.vue @@ -1,15 +1,15 @@ diff --git a/src/components/publish/parts/Media.vue b/src/components/publish/parts/Media.vue index 42a7cf7..c28ff3d 100644 --- a/src/components/publish/parts/Media.vue +++ b/src/components/publish/parts/Media.vue @@ -22,7 +22,7 @@ - + @@ -54,13 +54,11 @@ async function upload(file?: any) { const data = new FormData() if (!file) { - if (!picked.value) return - data.set("attachment", picked.value[0]) - } else { - data.set("attachment", file) + file = picked.value[0] } - data.set("hashcode", await calculateHashCode(picked.value[0])) + data.set("attachment", file) + data.set("hashcode", await calculateHashCode(file)) emits("update:uploading", true) const res = await request("interactive", "/api/attachments", { diff --git a/src/layouts/master.vue b/src/layouts/master.vue index 1637493..1e93acf 100644 --- a/src/layouts/master.vue +++ b/src/layouts/master.vue @@ -1,10 +1,29 @@