18e915bcbb
- 文章管理:计数请求补 page=1 参数,命中分页接口返回正确的 total - 分类管理:编辑模式新增描述输入框,保存时一并提交 description - CSP:img-src 加入 https: 允许加载外部图片 - 关于页:数据存储描述从 JSON 文件更正为 SQLite 数据库 - Footer:添加 ICP 备案号
25 lines
589 B
TypeScript
25 lines
589 B
TypeScript
/**
|
|
* Seed 脚本入口 — 可手动运行:`npx tsx src/lib/seed.ts`
|
|
*
|
|
* 运行时自动初始化已在 store.ts 的 ensureSeed() 中处理,
|
|
* 本脚本仅作为显式重置/查看用途。
|
|
*/
|
|
import { ensureSeed, getPosts, getCategories, getTags } from "./store";
|
|
|
|
async function main() {
|
|
await ensureSeed();
|
|
const [posts, categories, tags] = await Promise.all([
|
|
getPosts(),
|
|
getCategories(),
|
|
getTags(),
|
|
]);
|
|
console.log("Seed complete:", {
|
|
posts: posts.length,
|
|
categories: categories.length,
|
|
tags: tags.length,
|
|
});
|
|
process.exit(0);
|
|
}
|
|
|
|
main();
|