diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d14bccc4e..ad0fab173 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -372,7 +372,8 @@ class ApplicationController < ActionController::Base return true end - if allowed + + if allowed || (params[:type] && params[:type] == "wechat" ) true else if @project && @project.archived? diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 2e85d8a72..3986acc0a 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -130,7 +130,7 @@ class AttachmentsController < ApplicationController def download # modify by nwb # 下载添加权限设置 - if params[:type] == "wechat" + if (params[:type] && params[:type] == "wechat" ) candown = true else candown = attachment_candown @attachment @@ -715,7 +715,7 @@ class AttachmentsController < ApplicationController def has_login unless (@attachment && @attachment.container_type == "Organization").nil? unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil? - render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) + render_403 if (!User.current.logged? && !(params[:type] && params[:type] == "wechat")) && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) end end end