From 9997de0d9626ad8dd3acd78c7f9536ef40085e56 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 9 Sep 2016 15:14:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=AF=BE=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E4=B8=8D=E9=9C=80=E8=A6=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 7 ++++++- public/assets/wechat/class.html | 2 +- public/assets/wechat/myresource.html | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 5d1345f24..2e85d8a72 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -130,7 +130,12 @@ class AttachmentsController < ApplicationController def download # modify by nwb # 下载添加权限设置 - candown = attachment_candown @attachment + if params[:type] == "wechat" + candown = true + else + candown = attachment_candown @attachment + end + if candown || User.current.admin? || User.current.id == @attachment.author_id if stale?(:etag => @attachment.digest) if params[:preview] == 'true' diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index 88ef967e9..836575b90 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -230,7 +230,7 @@
-
{{r.filename}}发送
+
{{r.filename}}发送

暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。

diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index 718e3c278..1848dad60 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -12,7 +12,7 @@
- {{r.filename}}发送
+ {{r.filename}}发送
大小:{{r.attafile_size}}