Skip to content

Commit

Permalink
修复登录按钮的显示逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
kingwrcy committed Apr 10, 2024
1 parent 7846837 commit 15e91f5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/HeaderImg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div title="返回" v-if="showBack()" @click="navigateTo('/')">
<ArrowLeft color="#9FC84A" :size="20" class="cursor-pointer" />
</div>
<div title="登录" v-if="token">
<div title="登录" v-if="!token">
<LogIn :size="20" class="cursor-pointer" color="#9FC84A" @click="navigateTo('/login')" />
</div>

Expand Down
24 changes: 21 additions & 3 deletions components/MemoInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<PopoverContent as-child @interact-outside="music163Open = false">
<div class="">
<div class=" text-xs my-2 flex justify-between"><span>嵌入网易云音乐</span>
<NuxtLink to="https://jerry.mblog.club/simple-moments-import-music-and-video" class="text-gray-500 underline">如何获取?</NuxtLink>
<NuxtLink to="https://jerry.mblog.club/simple-moments-import-music-and-video"
class="text-gray-500 underline">如何获取?</NuxtLink>
</div>
<Input class="my-2" placeholder="请输入网易云音乐代码" v-model="music163Url" />
<Button size="sm" @click="importMusic">提交</Button>
Expand All @@ -60,7 +61,8 @@
<PopoverContent as-child @interact-outside="bilibiliOpen = false">
<div class="">
<div class=" text-xs my-2 flex justify-between"><span>嵌入B站视频</span>
<NuxtLink to="https://jerry.mblog.club/simple-moments-import-music-and-video" class="text-gray-500 underline">如何获取?</NuxtLink>
<NuxtLink to="https://jerry.mblog.club/simple-moments-import-music-and-video"
class="text-gray-500 underline">如何获取?</NuxtLink>
</div>
<Input class="my-2" placeholder="请输入B站视频代码" v-model="bilibiliUrl" />
<Button size="sm" @click="importBiliBili">提交</Button>
Expand Down Expand Up @@ -101,7 +103,8 @@



<Textarea autocomplete="new-text" v-model="content" rows="4" placeholder="今天发点什么呢?" class=" dark:bg-slate-500"></Textarea>
<Textarea @paste="pasteImg" autocomplete="new-text" v-model="content" rows="4" placeholder="今天发点什么呢?"
class=" dark:bg-slate-500"></Textarea>
<div class="absolute right-2 bottom-1 cursor-pointer text-xl" @click="toggleShowEmoji" ref="showEmojiRef">😊</div>
</div>

Expand Down Expand Up @@ -201,6 +204,21 @@ const logout = () => {
navigateTo('/', { replace: true })
}
const pasteImg = async (event: ClipboardEvent) => {
var items = event.clipboardData?.files
if (!items || items.length === 0) {
return;
}
await useUpload(items[0], async (res) => {
if (res.success) {
imgs.value = [...imgs.value, res.filename]
} else {
toast.warning(res.message || '上传失败')
}
})
}
const uploadImgs = async (event: Event) => {
const file = (event.target as HTMLInputElement).files?.[0]
if (!file) {
Expand Down

0 comments on commit 15e91f5

Please sign in to comment.