初始化政体志子站
收录 zhengquan-site 前后端完整代码:24 朝数据、24 幅权力结构图、 5 条沿革(67 节点 / 269 条细释)、44 个词条,以及部署配置与接口测试。
This commit is contained in:
commit
aa12b9f910
58 files changed
+16253
No files matched your search
@@ -0,0 +1,21 @@
|
||||
let boot = null;
|
||||
|
||||
export function setBootstrap(data) {
|
||||
boot = data;
|
||||
}
|
||||
|
||||
export const getBoot = () => boot;
|
||||
|
||||
export const site = () => boot?.site || { brand: '舆纪历史', name: '政体志', seal: '制' };
|
||||
export const eras = () => boot?.eras || [];
|
||||
export const dynasties = () => boot?.dynasties || [];
|
||||
export const threads = () => boot?.threads || [];
|
||||
export const stats = () => boot?.stats || {};
|
||||
|
||||
export const eraOf = (id) => eras().find((e) => e.id === id) || null;
|
||||
export const eraColor = (id) => eraOf(id)?.color || '#8a6320';
|
||||
export const dynastyOf = (slug) => dynasties().find((d) => d.slug === slug) || null;
|
||||
|
||||
export function indexOf(slug) {
|
||||
return dynasties().findIndex((d) => d.slug === slug);
|
||||
}
|
||||
Reference in new issue
Block a user