fixed 解决安全问题访问附件,id改为uuid,检测附件
This commit is contained in:
parent
d26dcb5b9a
commit
9526d1b896
|
@ -31,7 +31,7 @@ module Api::V1::Issues::Concerns::Checkable
|
||||||
def check_attachments (attachment_ids)
|
def check_attachments (attachment_ids)
|
||||||
raise ApplicationService::Error, "请输入正确的附件ID数组!" unless attachment_ids.is_a?(Array)
|
raise ApplicationService::Error, "请输入正确的附件ID数组!" unless attachment_ids.is_a?(Array)
|
||||||
attachment_ids.each do |aid|
|
attachment_ids.each do |aid|
|
||||||
raise ApplicationService::Error, "请输入正确的附件ID!" unless Attachment.exists?(id: aid)
|
raise ApplicationService::Error, "请输入正确的附件ID!" unless Attachment.exists?(id: aid) || Attachment.exists?(uuid: aid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue