mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 06:40:26 +08:00
修复部分API返回格式错误
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user