diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e53197b..5230135 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -473,13 +473,17 @@ class ApplicationController < ActionController::Base if (@site.mobile_on.eql?(true) && @site.mobile_api_openness_on.eql?(true)) session[:mobile_param] = if request.path.eql?(@mobile_path) - '1' + '1' + elsif request.path.eql?(root_path) + redirect_to mobile_path elsif params[:mobile] params[:mobile] else session[:mobile_param] end + request.format = :mobile if mobile_device? + elsif (@site.mobile_on.eql?(false) && @site.mobile_api_openness_on.eql?(true)) session[:mobile_param] = if (request.path.eql?(@mobile_app_path)) @@ -497,6 +501,8 @@ class ApplicationController < ActionController::Base session[:mobile_param] = if (request.path.eql?(@mobile_path)) '1' + elsif request.path.eql?(root_path) + redirect_to mobile_path elsif request.path.eql?(@mobile_app_path) redirect_to root_path(mobile: 0) elsif params[:mobile]