diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e6240714..535a75b6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -319,7 +319,6 @@ class ApplicationController < ActionController::Base end # Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) self.logged_user = nil - session[:third_party_user_id] = nil end end diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb index 6de07203..fa6e67ea 100644 --- a/app/services/cnmoocs_service.rb +++ b/app/services/cnmoocs_service.rb @@ -116,6 +116,7 @@ class CnmoocsService def source_url(params) user = User.find_by_id(params[:userId]) + return {error: -1, messages: "用户不存在,请先创建用户"} unless user token = Token.get_or_create_permanent_login_token(user) shixun = Shixun.find_by_id(params[:resouceId]) if shixun.blank?