From ef0a0e5ddd70d041e10fcce93485ed37c6f066e8 Mon Sep 17 00:00:00 2001 From: jasder Date: Wed, 23 Jun 2021 17:56:04 +0800 Subject: [PATCH] FIX [bug]cherry pick ce85273^..0bfed83 --- app/controllers/application_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 29595dc6..ed3049d2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -28,7 +28,7 @@ class ApplicationController < ActionController::Base DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z) OPENKEY = "79e33abd4b6588941ab7622aed1e67e8" - helper_method :current_user + helper_method :current_user, :base_url # 所有请求必须合法签名 def check_sign @@ -770,6 +770,10 @@ class ApplicationController < ActionController::Base @repository ||= load_project&.repository end + def base_url + Rails.application.config_for(:configuration)['platform_url'] || request.base_url + end + private def object_not_found uid_logger("Missing template or cant't find record, responding with 404")