diff --git a/app/forms/base_form.rb b/app/forms/base_form.rb index 74862e540..0a07e6036 100644 --- a/app/forms/base_form.rb +++ b/app/forms/base_form.rb @@ -58,7 +58,7 @@ class BaseForm def check_verifi_code(verifi_code, code) code = strip(code) return if code == "123123" && EduSetting.get("code_debug") # 万能验证码,用于测试 # TODO 万能验证码,用于测试 - return if EduSetting.get("is_local") == "true" # 本地版不需要验证码 + return if EduSetting.get("is_local") == "true" || Rails.application.config_for(:configuration)['is_local'].to_s =="true" # 本地版不需要验证码 raise VerifiCodeError, "验证码已失效" if !verifi_code&.effective? raise VerifiCodeError, "验证码不正确" if verifi_code&.code != code end diff --git a/config/configuration.yml.example b/config/configuration.yml.example index 59bb68406..5e71f66a2 100644 --- a/config/configuration.yml.example +++ b/config/configuration.yml.example @@ -1,5 +1,6 @@ default: &default platform_url: 'http://localhost:3000' + is_local: true wechat: appid: '123' secret: '123'