修改:分享增加代理权限

This commit is contained in:
2025-12-23 14:35:57 +08:00
parent 21fc156af0
commit 7b47f4512f
6 changed files with 216 additions and 13 deletions

View File

@@ -82,8 +82,15 @@ func (l *QueryGenerateShareLinkLogic) QueryGenerateShareLink(req *types.QueryGen
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "生成分享链接, 获取用户失败: %v", err)
}
if user.Inside != 1 {
// 检查是否是订单所有者或订单的代理
if order.UserId != userId {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "生成分享链接, 无权操作此订单")
isAgent, aerr := IsOrderAgent(l.ctx, l.svcCtx, userId, order.Id)
if aerr != nil {
return nil, aerr
}
if !isAgent {
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "生成分享链接, 无权操作此订单")
}
}
}