diff --git a/internal/service/siteinfo/siteinfo_service.go b/internal/service/siteinfo/siteinfo_service.go index b3bb6c80..a36dd50c 100644 --- a/internal/service/siteinfo/siteinfo_service.go +++ b/internal/service/siteinfo/siteinfo_service.go @@ -267,8 +267,11 @@ func (s *SiteInfoService) UpdateSMTPConfig(ctx context.Context, req *schema.Upda return } -func (s *SiteInfoService) GetSeo(ctx context.Context) (resp *schema.SiteSeoResp, err error) { - resp = &schema.SiteSeoResp{} +func (s *SiteInfoService) GetSeo(ctx context.Context) (resp *schema.SiteSeoReq, err error) { + resp = &schema.SiteSeoReq{} + if err = s.siteInfoCommonService.GetSiteInfoByType(ctx, constant.SiteTypeSeo, resp); err != nil { + return resp, err + } loginConfig, err := s.GetSiteLogin(ctx) if err != nil { log.Error(err) @@ -279,17 +282,6 @@ func (s *SiteInfoService) GetSeo(ctx context.Context) (resp *schema.SiteSeoResp, resp.Robots = "User-agent: *\nDisallow: /" return resp, nil } - - resp = &schema.SiteSeoResp{} - siteInfo, exist, err := s.siteInfoRepo.GetByType(ctx, constant.SiteTypeSeo) - if err != nil { - log.Error(err) - return resp, nil - } - if !exist { - return resp, nil - } - _ = json.Unmarshal([]byte(siteInfo.Content), resp) return resp, nil }