Files

52 lines
2.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* =====================================================================
* 全局常量与状态(state.js
* 各模块通过 import 共享;不包含任何 DOM 操作。
* ===================================================================== */
// 导航分区:life 生活区 / projects 项目区 / study 学习区(简介已并入首页,不再单独成区)
// 文章分区只有 life / studyprojects 是独立的项目专区
export const PARTITIONS = [
{ slug: "life", name: "我的生活" },
{ slug: "projects", name: "我的项目" },
{ slug: "study", name: "我的学习" },
];
// 文章分区中文名(用于面包屑、发布管理等展示)
export const ARTICLE_CATEGORIES = { life: "生活", study: "学习" };
// 简介默认值:实际内容优先从 /api/user/blogger 读取(博主可在管理面板修改)
export const ABOUT_DEFAULT = {
name: "孤竹居士",
tagline: "记录生活 · 折腾代码 · 终身学习",
bio: [
"你好,我是孤竹居士,欢迎来到我的个人博客。",
"这里记录我的生活点滴、项目实践与学习笔记。",
"文章分为公开与好友可见两种,欢迎申请成为好友。",
],
tags: ["Python", "Web", "Minecraft", "阅读"],
};
// 打赏二维码图片(随前端一起部署,Nginx 静态访问)
export const DONATE_IMAGE = "/icons/donate.png";
// 主页展示的社交账号链接(点击跳转对应平台主页)
export const SOCIAL_LINKS = [
{ name: "GitHub", url: "https://github.com/guzhujushi", icon: "/icons/github.svg" },
{ name: "YouTube", url: "https://www.youtube.com/@guzhujushi", icon: "/icons/youtube.svg" },
{ name: "哔哩哔哩", url: "https://b23.tv/DoV46bV", icon: "/icons/bilibili.svg" },
];
export const ROLE_NAMES = { blogger: "博主", friend: "好友", visitor: "游客" };
export const FRIEND_STATUS_TEXT = {
none: "申请好友",
pending: "等待博主审批",
accepted: "已是好友",
rejected: "重新申请好友",
blogger: "博主",
};
// 全局状态:登录用户与好友申请状态(none / pending / accepted / rejected / blogger
export const state = {
user: null, // { id, username, role }
friendStatus: "none",
};