Browse Source

/jump 登陆后跳转功能

pull/4/head
欧醚 4 years ago
parent
commit
d7400b4d34
2 changed files with 10 additions and 0 deletions
  1. +8
    -0
      app/controllers/jump_controller.rb
  2. +2
    -0
      config/routes.rb

+ 8
- 0
app/controllers/jump_controller.rb View File

@ -0,0 +1,8 @@
class JumpController < ApplicationController
before_action :authenticate_user!
def index
redirect_to("//#{params[:destin]}/#{params[:path]}")
end
end

+ 2
- 0
config/routes.rb View File

@ -451,6 +451,8 @@ Rails.application.routes.draw do
get '/about/more', to: 'about#more'
get '/terms', to: 'about#terms'
get '/jump/:destin/(*path)', to: 'jump#index', :constraints => { :destin => /[0-z\.]+/ }
match '/', via: [:post, :put, :patch, :delete], to: 'application#raise_not_found', format: false
match '*unmatched_route', via: :all, to: 'application#raise_not_found', format: false
end

Loading…
Cancel
Save