fix error

This commit is contained in:
邱博亞 2023-05-09 00:19:28 +08:00
parent dcbe1f2f2f
commit bfa657775f
1 changed files with 2 additions and 0 deletions

View File

@ -64,6 +64,7 @@ class Admin::RegisterApiController < ApplicationController
if site.nil? && site_token.blank? if site.nil? && site_token.blank?
send_token = true send_token = true
site = RegisteredSite.find_by(:site_domain => params[:site_domain]) rescue nil site = RegisteredSite.find_by(:site_domain => params[:site_domain]) rescue nil
site_token = site.uid
end end
if !site.nil? if !site.nil?
site.site_domain = params[:site_domain] site.site_domain = params[:site_domain]
@ -84,6 +85,7 @@ class Admin::RegisterApiController < ApplicationController
end end
if send_token if send_token
render :json => {"success" => true, 'site_anncs'=>site_anncs, 'store_token' => site_token}.to_json render :json => {"success" => true, 'site_anncs'=>site_anncs, 'store_token' => site_token}.to_json
puts ['send_token', site_token]
else else
render :json => {"success" => true, 'site_anncs'=>site_anncs}.to_json render :json => {"success" => true, 'site_anncs'=>site_anncs}.to_json
end end