mirror of
https://git.fightbot.fun/hxuanyu/BingPaper.git
synced 2026-02-15 16:59:32 +08:00
保存更多图片元数据并同步更新前端
This commit is contained in:
@@ -294,7 +294,7 @@
|
||||
<div class="bg-white/5 backdrop-blur-sm rounded-xl p-6 border border-white/10">
|
||||
<p class="text-white/70 mb-4">获取图片的元数据信息(标题、版权、日期等),只返回 JSON 数据不返回图片</p>
|
||||
|
||||
<div class="space-y-3">
|
||||
<div class="space-y-3 mb-6">
|
||||
<div class="flex items-center gap-3 text-sm">
|
||||
<code class="text-blue-400 font-mono">/image/today/meta</code>
|
||||
<span class="text-white/50">-</span>
|
||||
@@ -316,6 +316,45 @@
|
||||
<span class="text-white/60">图片列表(支持分页)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 元数据字段说明 -->
|
||||
<div class="mt-6 pt-6 border-t border-white/10">
|
||||
<h4 class="text-white/80 font-semibold mb-4">响应字段说明</h4>
|
||||
<div class="space-y-3 text-sm">
|
||||
<div class="flex gap-4">
|
||||
<code class="text-yellow-400 min-w-32">date</code>
|
||||
<span class="text-white/60">图片日期(格式:YYYY-MM-DD)</span>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<code class="text-yellow-400 min-w-32">title</code>
|
||||
<span class="text-white/60">图片标题</span>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<code class="text-yellow-400 min-w-32">copyright</code>
|
||||
<span class="text-white/60">版权信息</span>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<code class="text-yellow-400 min-w-32">copyrightlink</code>
|
||||
<span class="text-white/60">版权详情链接(指向 Bing 搜索页面)⭐ 新增</span>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<code class="text-yellow-400 min-w-32">startdate</code>
|
||||
<span class="text-white/60">发布开始日期(格式:YYYYMMDD)⭐ 新增</span>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<code class="text-yellow-400 min-w-32">fullstartdate</code>
|
||||
<span class="text-white/60">完整发布时间(格式:YYYYMMDDHHMM)⭐ 新增</span>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<code class="text-yellow-400 min-w-32">hsh</code>
|
||||
<span class="text-white/60">图片唯一哈希值 ⭐ 新增</span>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<code class="text-yellow-400 min-w-32">quiz</code>
|
||||
<span class="text-white/60">必应 quiz 链接(已废弃,建议使用 copyrightlink)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
查看大图
|
||||
</button>
|
||||
<button
|
||||
v-if="todayImage.quiz"
|
||||
@click="openQuiz(todayImage.quiz)"
|
||||
v-if="todayImage.copyrightlink"
|
||||
@click="openCopyrightLink(todayImage.copyrightlink)"
|
||||
class="px-6 py-3 bg-white/10 backdrop-blur-md text-white rounded-lg font-semibold hover:bg-white/20 transition-all border border-white/30"
|
||||
>
|
||||
了解更多
|
||||
@@ -145,7 +145,7 @@
|
||||
</router-link>
|
||||
|
||||
<a
|
||||
href="https://github.com"
|
||||
href="https://github.com/hanxuanyu/BingPaper"
|
||||
target="_blank"
|
||||
class="text-white/60 hover:text-white transition-colors text-sm flex items-center gap-2"
|
||||
>
|
||||
@@ -200,11 +200,10 @@ const viewImage = (date: string) => {
|
||||
router.push(`/image/${date}`)
|
||||
}
|
||||
|
||||
// 打开必应 quiz 链接
|
||||
const openQuiz = (quiz: string) => {
|
||||
// 拼接完整的必应地址
|
||||
const bingUrl = `https://www.bing.com${quiz}`
|
||||
window.open(bingUrl, '_blank')
|
||||
// 打开版权详情链接
|
||||
const openCopyrightLink = (link: string) => {
|
||||
// copyrightlink 是完整的 URL,直接打开
|
||||
window.open(link, '_blank')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -213,6 +212,7 @@ const openQuiz = (quiz: string) => {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
{{ image.copyright }}
|
||||
</p>
|
||||
|
||||
<!-- Quiz 链接 -->
|
||||
<!-- 版权详情链接 -->
|
||||
<a
|
||||
v-if="image.quiz"
|
||||
:href="getBingQuizUrl(image.quiz)"
|
||||
v-if="image.copyrightlink"
|
||||
:href="image.copyrightlink"
|
||||
target="_blank"
|
||||
class="inline-flex items-center gap-2 px-4 py-2 bg-white/20 hover:bg-white/30 text-white rounded-lg text-sm font-medium transition-all group"
|
||||
>
|
||||
@@ -175,10 +175,7 @@ const getFullImageUrl = () => {
|
||||
return bingPaperApi.getImageUrlByDate(currentDate.value, 'UHD', 'jpg')
|
||||
}
|
||||
|
||||
// 获取必应 quiz URL
|
||||
const getBingQuizUrl = (quiz: string) => {
|
||||
return `https://www.bing.com${quiz}`
|
||||
}
|
||||
// copyrightlink 现在是完整的 URL,无需额外处理
|
||||
|
||||
// 返回首页
|
||||
const goBack = () => {
|
||||
|
||||
Reference in New Issue
Block a user