|
|
@ -108,14 +108,6 @@ module Mobile
|
|
|
|
uw = UserWechat.find_by_openid(openid)
|
|
|
|
uw = UserWechat.find_by_openid(openid)
|
|
|
|
return uw.user if uw
|
|
|
|
return uw.user if uw
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
third_party_user_id = session[:third_party_user_id]
|
|
|
|
|
|
|
|
Rails.logger.info("#########third_party_user_id: #{third_party_user_id}")
|
|
|
|
|
|
|
|
if third_party_user_id
|
|
|
|
|
|
|
|
c_user = UserSource.find_by_id(session[:third_party_user_id])
|
|
|
|
|
|
|
|
return c_user.user if c_user
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
token = ApiKey.where(access_token: params[:token]).first
|
|
|
|
token = ApiKey.where(access_token: params[:token]).first
|
|
|
|
if token && !token.expired?
|
|
|
|
if token && !token.expired?
|
|
|
|
return User.find(token.user_id)
|
|
|
|
return User.find(token.user_id)
|
|
|
|