Skip to content

Commit dc4d042

Browse files
committed
feat(frontend): 添加投票横幅组件并更新页脚链接
- 新增 VoteBanner 组件用于显示社区投票信息 - 在首页和价格页面添加投票横幅 - 更新页脚添加 GitHub 链接 - 移除后端缓存日志输出
1 parent 7a0e7bc commit dc4d042

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed

backend/database/db.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ func cachePricePage(page, pageSize int, channelType, modelType string) {
321321

322322
// 存入缓存,有效期5分钟
323323
GlobalCache.Set(cacheKey, result, 5*time.Minute)
324-
log.Printf("已缓存价格查询: %s", cacheKey)
325324
}
326325

327326
// migrateModels 自动迁移模型到数据库表

frontend/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
<el-footer height="60px">
4141
<div class="footer-content">
42-
<p>© 2025 SUNAI | <a href="https://www.sunai.net/t/topic/277" target="_blank">介绍帖子</a></p>
42+
<p>© 2025 SUNAI | <a href="https://www.sunai.net/t/topic/277" target="_blank">介绍帖子</a> | <a href="https://github.com/woodchen-ink/aimodels-prices" target="_blank">GitHub</a></p>
4343
</div>
4444
</el-footer>
4545
</el-container>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<template>
2+
<el-alert
3+
v-if="!dismissed"
4+
title="社区投票进行中"
5+
type="info"
6+
:closable="true"
7+
@close="handleClose"
8+
class="vote-banner"
9+
>
10+
当前正在对是否保留"模型类别"进行投票,如有意向可
11+
<a href="https://www.sunai.net/t/topic/1084" target="_blank" class="vote-link">
12+
前往参与投票 →
13+
</a>
14+
</el-alert>
15+
</template>
16+
17+
<script setup>
18+
import { ref, onMounted } from 'vue'
19+
20+
const STORAGE_KEY = 'voteBannerDismissed'
21+
const dismissed = ref(false)
22+
23+
onMounted(() => {
24+
dismissed.value = localStorage.getItem(STORAGE_KEY) === 'true'
25+
})
26+
27+
function handleClose() {
28+
dismissed.value = true
29+
localStorage.setItem(STORAGE_KEY, 'true')
30+
}
31+
</script>
32+
33+
<style scoped>
34+
.vote-banner {
35+
margin-bottom: 16px;
36+
}
37+
38+
.vote-link {
39+
color: #409eff;
40+
text-decoration: none;
41+
font-weight: 500;
42+
}
43+
44+
.vote-link:hover {
45+
text-decoration: underline;
46+
}
47+
</style>

frontend/src/views/Home.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div class="home">
3+
<VoteBanner />
34
<el-card class="intro-card">
45
<template #header>
56
<div class="card-header">
@@ -230,6 +231,7 @@ h4 {
230231
<script setup>
231232
import { ref, onMounted } from 'vue'
232233
import { ElMessage } from 'element-plus'
234+
import VoteBanner from '@/components/VoteBanner.vue'
233235
234236
const origin = ref('')
235237

frontend/src/views/Prices.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div class="prices">
3+
<VoteBanner />
34
<el-card v-loading="loading" element-loading-text="加载中...">
45
<template #header>
56
<div class="card-header">
@@ -604,6 +605,7 @@ import axios from 'axios'
604605
import { ElMessage, ElMessageBox } from 'element-plus'
605606
import { useRouter } from 'vue-router'
606607
import { Edit, Delete, Check, Close, Document, Search, ArrowDown, User, Timer, InfoFilled } from '@element-plus/icons-vue'
608+
import VoteBanner from '@/components/VoteBanner.vue'
607609
608610
const props = defineProps({
609611
user: Object

0 commit comments

Comments
 (0)