pre_develop
daiao 6 years ago
parent 51e4759bcc
commit c6f4da3187

@ -34,7 +34,7 @@ module Mobile
version 'v1', using: :path version 'v1', using: :path
format :json format :json
content_type :json, "application/json;charset=UTF-8" content_type :json, "application/json;charset=UTF-8"
use ActionDispatch::Session::CookieStore, key: '_educoder_session' use ActionDispatch::Session::CookieStore
require 'digest' require 'digest'
use Mobile::Middleware::ErrorHandler use Mobile::Middleware::ErrorHandler

@ -43,11 +43,13 @@ module Mobile
requires :accessType, type: Integer, desc: "资源类型" requires :accessType, type: Integer, desc: "资源类型"
end end
get "source_url" do get "source_url" do
if session[:third_party_user_id].blank? if session[:third_party_user_id].blank?
user = User.find(params[:userId]) user = User.find(params[:userId])
session[:third_party_user_id] = user.user_source.id session[:third_party_user_id] = user.user_source.id
#self.logged_user = user
end end
Rails.logger.info("####session: #{session}")
CnmoocsService.new.source_url(params) CnmoocsService.new.source_url(params)
end end

@ -293,6 +293,7 @@ class AccountController < ApplicationController
UserActions.create(:action_id => User.current.id, :action_type => "Logout", :user_id => User.current.id) UserActions.create(:action_id => User.current.id, :action_type => "Logout", :user_id => User.current.id)
logout_user logout_user
# 记录用户登出行为 # 记录用户登出行为
logger.info("#########logout_session: #{session}")
redirect_to home_path redirect_to home_path
end end
# display the logout form # display the logout form

Loading…
Cancel
Save