Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

抓取周边信息,没有权限 #7

Open
Err0rZero opened this issue Jun 28, 2017 · 5 comments
Open

抓取周边信息,没有权限 #7

Err0rZero opened this issue Jun 28, 2017 · 5 comments

Comments

@Err0rZero
Copy link

抓取周边信息,提取没有权限,这是为何?

@PENGZhaoqing
Copy link
Owner

先登录,用seed.rb里的账号密码

@Err0rZero
Copy link
Author

登陆了,还是显示没有权限

@PENGZhaoqing
Copy link
Owner

在每个app/controllers/xx_controller.rb中,通过before_action来判断当前用户是否存在(已登录),若未登录成功,则不会让其抓取,强制返回主页,你看是不是这里出了问题,你这边可以取消这个限制

class HospitalsController < ApplicationController

  before_action :login, only: [:ajax]  
  ...
  private

  def login
    if current_user.nil?
      redirect_to root_path, flash: {:warning => "只有管理员能进行此操作喔"}
    end
  end

end

@Err0rZero
Copy link
Author

NoMethodError (undefined method buses_houses' for nil:NilClass): app/controllers/buses_controller.rb:10:in ajax'

@PENGZhaoqing
Copy link
Owner

房屋的坐标整合没

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants