A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
feat(seo): If the site is set to privacy mode, prohibit crawling any page
LinkinStar4fa01db61c47
diff --git a/internal/service/siteinfo/siteinfo_service.go b/internal/service/siteinfo/siteinfo_service.goindex cdcad1f5..afbd7edd 100644--- a/internal/service/siteinfo/siteinfo_service.go+++ b/internal/service/siteinfo/siteinfo_service.go@@ -255,6 +255,18 @@ func (s *SiteInfoService) UpdateSMTPConfig(ctx context.Context, req *schema.Upda}func (s *SiteInfoService) GetSeo(ctx context.Context) (resp *schema.SiteSeoResp, err error) {+ resp = &schema.SiteSeoResp{}+ loginConfig, err := s.GetSiteLogin(ctx)+ if err != nil {+ log.Error(err)+ return resp, nil+ }+ // If the site is set to privacy mode, prohibit crawling any page.+ if loginConfig.LoginRequired {+ resp.Robots = "User-agent: *\nDisallow: /"+ return resp, nil+ }+resp = &schema.SiteSeoResp{}siteInfo, exist, err := s.siteInfoRepo.GetByType(ctx, constant.SiteTypeSeo)if err != nil {