请求限制API支持用户调用

This commit is contained in:
刘祥超
2022-08-25 15:35:55 +08:00
parent 5d336eb77d
commit f4f5389ffb

View File

@@ -663,13 +663,20 @@ func (this *HTTPWebService) UpdateHTTPWebCommon(ctx context.Context, req *pb.Upd
// UpdateHTTPWebRequestLimit 修改请求限制
func (this *HTTPWebService) UpdateHTTPWebRequestLimit(ctx context.Context, req *pb.UpdateHTTPWebRequestLimitRequest) (*pb.RPCSuccess, error) {
_, err := this.ValidateAdmin(ctx)
_, userId, err := this.ValidateAdminAndUser(ctx)
if err != nil {
return nil, err
}
var tx = this.NullTx()
if userId > 0 {
err = models.SharedHTTPWebDAO.CheckUserWeb(tx, userId, req.HttpWebId)
if err != nil {
return nil, err
}
}
var config = &serverconfigs.HTTPRequestLimitConfig{}
err = json.Unmarshal(req.RequestLimitJSON, config)
if err != nil {