FileCodeBox Go 重写版 v2.5.6(安全审计修复版)
Go 1.27.1 (Gin+GORM) + Vue 3 文件快传服务: - 安全审计全部修复(docs/security-audit-2026-09-05.md): bcrypt 密码哈希与自动升级、presign 直传服务端大小/内容校验、 全局请求体上限、依赖升级(govulncheck 0 命中)、janitor 后台清理、 管理端审计动作落库、/admin CORS 收紧、通知内容白名单净化、 会话默认 7 天、限流缓存故障降级、robots.txt 端点等 - 前端:取件链接复制修复(不再重复拼接提取码)、markdown 净化器加固 - Redis 支持库号(FCB_REDIS_DB / redis://…/db URL) - 文档:docs/api/* 与 openapi.yaml 同步最新行为(robots.txt、 提码 5 位起、chunk 32MiB 上限、admin 审计动作等) 验证:gofmt/go vet/go test 全绿;二进制端到端冒烟通过
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
/** 通用分页器 */
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const props = defineProps<{
|
||||
page: number
|
||||
size: number
|
||||
total: number
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
change: [page: number, size: number]
|
||||
}>()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const totalPages = computed(() => Math.max(1, Math.ceil(props.total / props.size)))
|
||||
|
||||
function go(p: number): void {
|
||||
const target = Math.min(Math.max(1, p), totalPages.value)
|
||||
if (target !== props.page) emit('change', target, props.size)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="pager">
|
||||
<span class="pager-info">{{ t('common.pagerInfo', { total, page, pages: totalPages }) }}</span>
|
||||
<button class="btn btn-ghost btn-sm" type="button" :disabled="page <= 1" @click="go(page - 1)">
|
||||
{{ t('common.previousPage') }}
|
||||
</button>
|
||||
<button class="btn btn-ghost btn-sm" type="button" :disabled="page >= totalPages" @click="go(page + 1)">
|
||||
{{ t('common.nextPage') }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user