修复部分API返回格式错误

This commit is contained in:
刘祥超
2024-02-24 09:52:47 +08:00
parent b7dc2738e2
commit e763095756
2 changed files with 5 additions and 15 deletions

View File

@@ -1466,7 +1466,7 @@ func (this *HTTPWebDAO) UpdateWebReferers(tx *dbs.Tx, webId int64, referersConfi
return this.NotifyUpdate(tx, webId)
}
// FindWebReferers 查找服务的防盗链配置
// FindWebReferers 查找网站的防盗链配置
func (this *HTTPWebDAO) FindWebReferers(tx *dbs.Tx, webId int64) ([]byte, error) {
return this.Query(tx).
Pk(webId).

View File

@@ -972,18 +972,13 @@ func (this *HTTPWebService) FindHTTPWebReferers(ctx context.Context, req *pb.Fin
}
}
config, err := models.SharedHTTPWebDAO.FindWebReferers(tx, req.HttpWebId)
if err != nil {
return nil, err
}
configJSON, err := json.Marshal(config)
referersJSON, err := models.SharedHTTPWebDAO.FindWebReferers(tx, req.HttpWebId)
if err != nil {
return nil, err
}
return &pb.FindHTTPWebReferersResponse{
ReferersJSON: configJSON,
ReferersJSON: referersJSON,
}, nil
}
@@ -1040,18 +1035,13 @@ func (this *HTTPWebService) FindHTTPWebUserAgent(ctx context.Context, req *pb.Fi
}
}
config, err := models.SharedHTTPWebDAO.FindWebUserAgent(tx, req.HttpWebId)
if err != nil {
return nil, err
}
configJSON, err := json.Marshal(config)
userAgentJSON, err := models.SharedHTTPWebDAO.FindWebUserAgent(tx, req.HttpWebId)
if err != nil {
return nil, err
}
return &pb.FindHTTPWebUserAgentResponse{
UserAgentJSON: configJSON,
UserAgentJSON: userAgentJSON,
}, nil
}