Skip to content

Commit 4771205

Browse files
author
Jerry
committed
优化样式
1 parent c97b3df commit 4771205

File tree

10 files changed

+22
-11
lines changed

10 files changed

+22
-11
lines changed

backend/handler/memo.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,17 @@ func (m MemoHandler) RemoveMemo(c echo.Context) error {
216216
if m.base.db.Delete(&memo).RowsAffected != 1 {
217217
return FailRespWithMsg(c, Fail, "删除失败")
218218
}
219+
220+
if memo.Imgs != "" {
221+
imgs := strings.Split(memo.Imgs, ",")
222+
for _, img := range imgs {
223+
if !strings.HasPrefix(img, "/upload/") {
224+
return SuccessResp(c, h{})
225+
}
226+
img := strings.ReplaceAll(img, "/upload/", "")
227+
_ = os.Remove(filepath.Join(m.base.cfg.UploadDir, img))
228+
}
229+
}
219230
return SuccessResp(c, h{})
220231
}
221232

front/components/DoubanEdit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<UPopover :ui="{base:'w-[300px]'}" :popper="{ arrow: true }" mode="click">
3-
<svg class="focus:outline-0 cursor-pointer w-[18px] h-[18px]" xmlns="http://www.w3.org/2000/svg"
3+
<svg class="focus:outline-0 cursor-pointer w-10 h-10 sm:w-6 sm:h-6" xmlns="http://www.w3.org/2000/svg"
44
viewBox="0 0 24 24" fill="currentColor" data-state="closed">
55
<path
66
d="M15.2735 15H5V7H19V15H17.3764L16.0767 19H21V21H3V19H7.6123L6.8 16.5L8.70211 15.882L9.71522 19H13.9738L15.2735 15ZM3.5 3H20.5V5H3.5V3ZM7 9V13H17V9H7Z"

front/components/ExternalUrl.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<UPopover :popper="{ arrow: true }" mode="click">
3-
<UIcon name="i-carbon-link"/>
3+
<UIcon name="i-carbon-link" class="w-10 h-10 sm:w-6 sm:h-6"/>
44
<template #panel="{close}">
55
<div class="p-4 flex flex-col gap-2">
66
<UInput v-model="url" placeholder="请输入分享的链接"/>

front/components/ExternalUrlPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div v-if="props.url"
3-
class="flex flex-row gap-2 my-2 bg-[#f7f7f7] dark:bg-[#212121] items-center p-2 border rounded"
3+
class="flex flex-row gap-2 my-2 bg-[#f7f7f7] dark:bg-[#212121] items-center dark:border-gray-700/50 p-2 border rounded"
44
>
55
<img class="w-8 h-8" :src="props.favicon" alt=""><a
66
:href="props.url" target="_blank" class="text-[#576b95]">{{ props.title }}</a>

front/components/MemoEdit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="px-4 space-y-2">
3-
<div class="flex gap-2 text-lg text-gray-600">
3+
<div class="flex gap-2 text-lg text-gray-600 pt-4 ">
44
<ExternalUrl v-model:favicon="state.externalFavicon" v-model:title="state.externalTitle"
55
v-model:url="state.externalUrl"/>
66

front/components/Music.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<UPopover :ui="{base:'w-[350px] min-h-[350px]'}" :popper="{ arrow: true }" mode="click">
3-
<UIcon name="i-carbon-music" class="cursor-pointer"/>
3+
<UIcon name="i-carbon-music" class="cursor-pointer w-10 h-10 sm:w-6 sm:h-6"/>
44
<template #panel="{close}">
55
<div class="p-4 flex flex-col gap-2 max-h-[400px] overflow-auto">
66
<div class="text-xs text-gray-400">嵌入在线音乐</div>

front/components/UploadImage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<UPopover :popper="{ arrow: true }" mode="click">
3-
<UIcon name="i-carbon-image" class="cursor-pointer"/>
3+
<UIcon name="i-carbon-image" class="cursor-pointer w-10 h-10 sm:w-6 sm:h-6"/>
44
<template #panel="{close}">
55
<div class="p-4 flex flex-col gap-2">
66
<div class="text-xs text-gray-400">本地上传</div>

front/components/UploadImagePreview.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ watch(images, () => {
4747
// })
4848
4949
const removeImage = async (img: string) => {
50-
// await useMyFetch('/memo/removeImage',{
51-
// img
52-
// })
50+
await useMyFetch('/memo/removeImage',{
51+
img
52+
})
5353
emit('removeImage', img)
5454
}
5555

front/components/UploadVideo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<UPopover :ui="{base:'w-[300px]'}" :popper="{ arrow: true }" mode="click">
3-
<UIcon name="i-carbon-video-player" class="cursor-pointer"/>
3+
<UIcon name="i-carbon-video-player" class="cursor-pointer w-10 h-10 sm:w-6 sm:h-6"/>
44
<template #panel="{close}">
55
<div class="p-4 flex flex-col gap-2">
66
<div class="text-xs text-gray-400">嵌入b站视频</div>

front/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "module",
55
"scripts": {
66
"build": "nuxt build",
7-
"dev": "nuxt dev",
7+
"dev": "nuxt dev --host 0.0.0.0",
88
"generate": "nuxt generate",
99
"preview": "nuxt preview",
1010
"postinstall": "nuxt prepare"

0 commit comments

Comments
 (0)