From 8644ad178c6761c5376f6ce494c1f934f75af91e Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Thu, 1 Sep 2016 10:21:29 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8F=AD=E7=BA=A7=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=20=E5=88=A0=E9=99=A4=E6=88=90=E5=91=98=E7=9A=84BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/api/mobile/apis/courses.rb | 2 +-
app/services/courses_service.rb | 5 +++--
public/assets/wechat/class.html | 4 ++--
public/assets/wechat/project.html | 4 ++--
public/javascripts/wechat/controllers/class_publishissue.js | 2 +-
public/javascripts/wechat/controllers/class_publishnotice.js | 2 +-
public/javascripts/wechat/controllers/project_publishnote.js | 2 +-
7 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb
index 6a4175706..c8b67448e 100644
--- a/app/api/mobile/apis/courses.rb
+++ b/app/api/mobile/apis/courses.rb
@@ -734,7 +734,7 @@ module Mobile
out = {status: status}
message = case status
when 0; "退出班级成功"
- when 1; "您不在课程中"
+ when 1; "您不是该班级成员"
when 2; "您还未登录"
when 3; "管理员不能退出班级"
else; "未知错误,请稍后再试"
diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb
index c5084f228..f23b59dcb 100644
--- a/app/services/courses_service.rb
+++ b/app/services/courses_service.rb
@@ -79,7 +79,8 @@ class CoursesService
else
c = Course.find(course)
end
- if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c)))
+ # if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c)))
+ if current_user.nil?
raise '403'
end
#@canShowCode = isCourseTeacher(User.current.id,course) && params[:role] != '1'
@@ -458,8 +459,8 @@ class CoursesService
joined = StudentsForCourse.where('student_id = ? and course_id = ?', user.id, params[:object_id])
joined.each do |join|
join.delete
- @state = 0
end
+ @state = 0
@state
end
diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html
index 8208c3883..706cf5206 100644
--- a/public/assets/wechat/class.html
+++ b/public/assets/wechat/class.html
@@ -217,7 +217,7 @@
-
-
diff --git a/public/assets/wechat/project.html b/public/assets/wechat/project.html
index 8dfba3619..89cbb1418 100644
--- a/public/assets/wechat/project.html
+++ b/public/assets/wechat/project.html
@@ -98,7 +98,7 @@
-
@@ -138,7 +138,7 @@
-
diff --git a/public/javascripts/wechat/controllers/class_publishissue.js b/public/javascripts/wechat/controllers/class_publishissue.js
index 1cd7f1285..09b995bea 100644
--- a/public/javascripts/wechat/controllers/class_publishissue.js
+++ b/public/javascripts/wechat/controllers/class_publishissue.js
@@ -55,7 +55,7 @@ app.controller('ClassPublishIssueController', ['$scope', '$http', 'auth', 'confi
).then(function(response){
if(response.data.status == 0)
{
- vm.alertService.showMessage('提示', '您已成功发布问题',function(){
+ vm.alertService.showMessage('提示', '发布成功',function(){
rms.save('course_activities_page',0);
rms.save("course_activities",[]);
rms.save("course_has_more",false);
diff --git a/public/javascripts/wechat/controllers/class_publishnotice.js b/public/javascripts/wechat/controllers/class_publishnotice.js
index a0b9ab676..b900305c1 100644
--- a/public/javascripts/wechat/controllers/class_publishnotice.js
+++ b/public/javascripts/wechat/controllers/class_publishnotice.js
@@ -55,7 +55,7 @@ app.controller('ClassPublishNoticeController', ['$scope', '$http', 'auth', 'conf
).then(function(response){
if(response.data.status == 0)
{
- vm.alertService.showMessage('提示', '您已成功发布通知',function(){
+ vm.alertService.showMessage('提示', '发布成功',function(){
rms.save('course_activities_page',0);
rms.save("course_activities",[]);
rms.save("course_has_more",false);
diff --git a/public/javascripts/wechat/controllers/project_publishnote.js b/public/javascripts/wechat/controllers/project_publishnote.js
index 231faaea6..f39b32827 100644
--- a/public/javascripts/wechat/controllers/project_publishnote.js
+++ b/public/javascripts/wechat/controllers/project_publishnote.js
@@ -56,7 +56,7 @@ app.controller('ProjectPublishNoteController', ['$scope', '$http', 'auth', 'conf
).then(function(response){
if(response.data.status == 0)
{
- vm.alertService.showMessage('提示', '您已成功发布帖子',function(){
+ vm.alertService.showMessage('提示', '发布成功',function(){
rms.save('project_activities_page',0);
rms.save("project_activities",[]);
rms.save("project_has_more",false);