feat: 管理端板块管理与旧版数据导入,补充部署运营文档
- 新增管理端板块管理页面与后端接口(admin_board) - 新增旧版数据导入:legacyimport 服务、导入面板、importusers 命令行工具 - 聊天用户卡片、板块图标等 UI 组件与界面优化 - 补充 about/公告/1Panel 部署等文档 - gitignore 排除 dist/ 构建产物与 .agents/ 本地工具目录
This commit is contained in:
@@ -17,6 +17,8 @@ const (
|
||||
SettingKeyAccent = "theme_accent"
|
||||
// SettingKeyTrustReviewedPublish 已过审用户后续发帖/评论免审;缺行视为开启(默认开)
|
||||
SettingKeyTrustReviewedPublish = "trust_reviewed_publish"
|
||||
// SettingKeyPublishWithoutReview 全站免审:所有人发帖/评论直接公开,无需过审记录;缺行视为关闭(默认关)
|
||||
SettingKeyPublishWithoutReview = "publish_without_review"
|
||||
SettingKeySiteName = "site_name"
|
||||
SettingKeySiteDescription = "site_description"
|
||||
SettingKeyAllowRegister = "allow_register"
|
||||
@@ -99,6 +101,7 @@ var accentHexRe = regexp.MustCompile(`^#[0-9a-fA-F]{6}$`)
|
||||
type PublicSiteSettings struct {
|
||||
Accent string `json:"accent"`
|
||||
TrustReviewedPublish bool `json:"trust_reviewed_publish"`
|
||||
PublishWithoutReview bool `json:"publish_without_review"`
|
||||
SiteName string `json:"site_name"`
|
||||
SiteDescription string `json:"site_description"`
|
||||
AllowRegister bool `json:"allow_register"`
|
||||
@@ -210,6 +213,7 @@ func (s *SettingService) Public() (PublicSiteSettings, error) {
|
||||
SiteName: DefaultSiteName,
|
||||
SiteDescription: DefaultSiteDescription,
|
||||
TrustReviewedPublish: true,
|
||||
PublishWithoutReview: false,
|
||||
AllowRegister: true,
|
||||
AllowComments: true,
|
||||
CommentsRequireLogin: false,
|
||||
@@ -247,6 +251,12 @@ func (s *SettingService) Public() (PublicSiteSettings, error) {
|
||||
}
|
||||
out.TrustReviewedPublish = trust
|
||||
|
||||
withoutReview, err := s.PublishWithoutReview()
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
out.PublishWithoutReview = withoutReview
|
||||
|
||||
name, found, err := s.getValue(SettingKeySiteName)
|
||||
if err != nil {
|
||||
return out, err
|
||||
@@ -429,6 +439,20 @@ func (s *SettingService) SetTrustReviewedPublish(on bool) error {
|
||||
return s.setBoolDefaultTrue(SettingKeyTrustReviewedPublish, on)
|
||||
}
|
||||
|
||||
// PublishWithoutReview 全站免审:所有人发布内容直接公开(优先于过审免审)。缺行视为关闭。
|
||||
func (s *SettingService) PublishWithoutReview() (bool, error) {
|
||||
v, found, err := s.getValue(SettingKeyPublishWithoutReview)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return parseBoolDefaultFalse(v, found), nil
|
||||
}
|
||||
|
||||
// SetPublishWithoutReview 持久化全站免审开关;关闭时删键保持「缺行=默认关」。
|
||||
func (s *SettingService) SetPublishWithoutReview(on bool) error {
|
||||
return s.setBoolDefaultFalse(SettingKeyPublishWithoutReview, on)
|
||||
}
|
||||
|
||||
func (s *SettingService) SetSiteName(name string) error {
|
||||
name = strings.TrimSpace(name)
|
||||
if name == "" || name == DefaultSiteName {
|
||||
|
||||
Reference in New Issue
Block a user