Compare commits
2 Commits
8ea08e74a0
...
b18f20dbe0
| Author | SHA1 | Date | |
|---|---|---|---|
| b18f20dbe0 | |||
| 408ce1a22c |
@@ -52,10 +52,17 @@ func (l *QueryDetailByOrderIdLogic) QueryDetailByOrderId(req *types.QueryDetailB
|
|||||||
}
|
}
|
||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告查询, 查找报告错误: %+v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告查询, 查找报告错误: %+v", err)
|
||||||
}
|
}
|
||||||
|
user, err := l.svcCtx.UserModel.FindOne(l.ctx, userId)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告查询, 查找用户错误: %+v", err)
|
||||||
|
}
|
||||||
// 安全验证:确保订单属于当前用户
|
// 安全验证:确保订单属于当前用户
|
||||||
|
// 如果用户是内部用户(Inside==1),无需校验订单归属
|
||||||
|
if user.Inside != 1 {
|
||||||
if order.UserId != userId {
|
if order.UserId != userId {
|
||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.LOGIC_QUERY_NOT_FOUND), "无权查看此订单报告")
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.LOGIC_QUERY_NOT_FOUND), "无权查看此订单报告")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 创建渐进式延迟策略实例
|
// 创建渐进式延迟策略实例
|
||||||
progressiveDelayOrder, err := delay.New(200*time.Millisecond, 3*time.Second, 10*time.Second, 1.5)
|
progressiveDelayOrder, err := delay.New(200*time.Millisecond, 3*time.Second, 10*time.Second, 1.5)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user