fix error
This commit is contained in:
parent
03ea7ed804
commit
a8be974144
|
@ -13,7 +13,7 @@ class Site
|
|||
field :password_failed_lock_num, type: Integer, default: 5
|
||||
field :password_failed_lock_time, type: Integer, default: 1
|
||||
field :password_change_constrained, type: Integer, default: 0
|
||||
|
||||
field :view_count_start, type: Integer, default: 0
|
||||
field :social_share_hide_in_menu, type: Boolean, default: false
|
||||
field :social_share_position, type: Integer, default: 0
|
||||
field :render_popup_only_on_root, type: Boolean, default: false
|
||||
|
@ -118,18 +118,19 @@ class Site
|
|||
field :need_update_mobile_menu_cache , :type => Boolean, :default => true, localize: true
|
||||
field :has_sub_home , :type => Boolean, :default => false
|
||||
field :prohibit_general_memebers_access_backend_member_page , :type => Boolean, :default => false
|
||||
field :avoid_member_display_in_wrong_show_page , :type => Boolean, :default => true
|
||||
mount_uploader :default_image, ImageUploader
|
||||
mount_uploader :site_logo, ImageUploader
|
||||
mount_uploader :site_logo_1, ImageUploader
|
||||
mount_uploader :favicon, ImageUploader
|
||||
mount_uploader :mobile_icon, ImageUploader
|
||||
before_save do
|
||||
begin
|
||||
cache_header(false)
|
||||
rescue => e
|
||||
File.open("test.html","w+"){|f| f.write(e.backtrace.join(""))}
|
||||
puts "cache header failed"
|
||||
end
|
||||
# begin
|
||||
# cache_header(false)
|
||||
# rescue => e
|
||||
# File.open("test.html","w+"){|f| f.write(e.backtrace.join(""))}
|
||||
# puts "cache header failed"
|
||||
# end
|
||||
end
|
||||
after_save do
|
||||
File.open("config/member_extra_db.txt","w+"){|f| f.write(self.member_extra_db)}
|
||||
|
@ -152,6 +153,10 @@ class Site
|
|||
end
|
||||
end
|
||||
end
|
||||
def default_locale
|
||||
tmp = super()
|
||||
tmp.blank? ? "zh_tw" : tmp
|
||||
end
|
||||
def register_site(url,university,department,email,country)
|
||||
api_key = STORE_CONFIG[:store_settings]["api_key"]
|
||||
self.generate_site_token
|
||||
|
|
Loading…
Reference in New Issue