fix error
This commit is contained in:
parent
6bf0bfd6bd
commit
dcbe1f2f2f
|
@ -59,7 +59,12 @@ class Admin::RegisterApiController < ApplicationController
|
|||
|
||||
def re_register_url
|
||||
site_token = params[:store_token]
|
||||
send_token = false
|
||||
site = RegisteredSite.find_by(:uid => site_token) rescue nil
|
||||
if site.nil? && site_token.blank?
|
||||
send_token = true
|
||||
site = RegisteredSite.find_by(:site_domain => params[:site_domain]) rescue nil
|
||||
end
|
||||
if !site.nil?
|
||||
site.site_domain = params[:site_domain]
|
||||
site.save
|
||||
|
@ -77,7 +82,11 @@ class Admin::RegisterApiController < ApplicationController
|
|||
end
|
||||
{title: v.title,content: v.content,see_more_link: v.see_more_link}
|
||||
end
|
||||
render :json => {"success" => true,'site_anncs'=>site_anncs}.to_json
|
||||
if send_token
|
||||
render :json => {"success" => true, 'site_anncs'=>site_anncs, 'store_token' => site_token}.to_json
|
||||
else
|
||||
render :json => {"success" => true, 'site_anncs'=>site_anncs}.to_json
|
||||
end
|
||||
else
|
||||
render :json => {"success" => false}.to_json
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue