This commit is contained in:
yystopf 2021-08-10 17:08:51 +08:00
parent 495d7773fe
commit 0f45e8f44b
1 changed files with 2 additions and 1 deletions

View File

@ -775,7 +775,8 @@ class ApplicationController < ActionController::Base
end
def convert_image!
@image = params[:image] || user_params[:image]
@image = params[:image]
@image = @image.nil? && params[:user].present? ? params[:user][:image] : @image
return unless @image.present?
max_size = EduSetting.get('upload_avatar_max_size') || 2 * 1024 * 1024 # 2M
if @image.class == ActionDispatch::Http::UploadedFile