You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/config/initializers/util_wechat_init.rb

17 lines
521 B

wechat_config = {}
begin
config = Rails.application.config_for(:configuration)
wechat_config = config['wechat']
raise 'wechat config missing' if wechat_config.blank?
rescue => ex
raise ex if Rails.env.production?
puts %Q{\033[33m [warning] wechat config or configuration.yml missing,
please add it or execute 'cp config/configuration.yml.example config/configuration.yml' \033[0m}
wechat_config = {}
end
Util::Wechat.appid = wechat_config['appid']
Util::Wechat.secret = wechat_config['secret']