change url mechanism

This commit is contained in:
Harry Bomrah 2016-04-15 18:18:58 +08:00
parent f66b53a691
commit cd2666dd74
2 changed files with 12 additions and 0 deletions

View File

@ -45,6 +45,17 @@ class Admin::RegisterApiController < ApplicationController
end
end
def re_register_url
site_token = params[:store_token]
site = RegisteredSite.find_by(:uid => site_token) rescue nil
if !site.nil?
site.site_domain = params[:site_domain]
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def check_permissions
response = {}
response["success"] = false

View File

@ -3,6 +3,7 @@ Rails.application.routes.draw do
locales = Site.first.in_use_locales rescue I18n.available_locales
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
post "/xhr/site/re_register_url", to: 'admin/register_api#re_register_url'
namespace :admin do
get "/registered_site/change_access/:uid" => "registered_sites#change_access_status"
resources :registered_sites