fix version 1
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"bsm/full/module/ec/order/internal/models"
|
||||
pb "bsm/full/module/ec/order/pb"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/env"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/printer"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
@@ -21,6 +22,11 @@ func SimulateReceiving(ctx context.Context, in *pb.OrderIdentRequest) (reply *pb
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 模拟接口仅允许在 dev 模式使用,其它模式默认关闭,避免生产环境被用于伪造收货、推进订单状态。
|
||||
if env.Runtime == nil || env.Runtime.Mode != "dev" {
|
||||
return nil, errcode.ErrPermissionDenied
|
||||
}
|
||||
// valildate request id,identity.
|
||||
if in.Id == 0 && in.Identity == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
|
||||
Reference in New Issue
Block a user