From d0562f1ede8e25987a35543ea9fc4d48e1bbe19f Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 9 Apr 2015 16:05:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=AF=BE=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E8=BE=93?= =?UTF-8?q?=E5=AF=86=E7=A0=81=EF=BC=8C=E9=82=A3=E5=B0=B1=E7=94=A8=E5=8E=9F?= =?UTF-8?q?=E6=9D=A5=E7=9A=84=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/apis/courses.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 6d68d549a..08c7adf10 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -80,6 +80,10 @@ module Mobile class_period: params[:class_period] } course = ::Course.find(params[:course_id]) + # 如果没有传密码过来,那就把原来的密码给上,不然会不更新 + if params[:password].nil? || params[:password].blank? + cs_params[:course][:password] = course[:password] + end cs.edit_course_authorize(current_user,course) course = cs.edit_course(cs_params, course,current_user) present :data, course, with: Mobile::Entities::Course