Quellcode durchsuchen

fix: support full http paths for scale_user avatar

Your Name vor 9 Stunden
Ursprung
Commit
675b1e7ca3
2 geänderte Dateien mit 37 neuen und 2 gelöschten Zeilen
  1. 36 2
      Gemfile.lock
  2. 1 0
      app/models/scale_user.rb

+ 36 - 2
Gemfile.lock

@@ -1,5 +1,5 @@
 GEM
-  remote: http://gems.ruby-china.org/
+  remote: https://gems.ruby-china.com/
   specs:
     actionmailer (4.2.7.1)
       actionpack (= 4.2.7.1)
@@ -44,7 +44,9 @@ GEM
     arel (6.0.3)
     autoprefixer-rails (6.5.3)
       execjs
+    bcrypt (3.1.11)
     bcrypt (3.1.11-x64-mingw32)
+    bcrypt-ruby (3.0.1)
     bootstrap-sass (3.3.7)
       autoprefixer-rails (>= 5.2.1)
       sass (>= 3.3.4)
@@ -79,6 +81,7 @@ GEM
     compass-import-once (1.0.5)
       sass (>= 3.2, < 3.5)
     concurrent-ruby (1.0.2)
+    daemons (1.4.0)
     devise (4.2.0)
       bcrypt (~> 3.0)
       orm_adapter (~> 0.1)
@@ -88,7 +91,9 @@ GEM
     domain_name (0.5.20161129)
       unf (>= 0.0.5, < 1.0.0)
     erubis (2.7.0)
+    eventmachine (1.2.7)
     execjs (2.7.0)
+    ffi (1.9.14)
     ffi (1.9.14-x64-mingw32)
     font-awesome-rails (4.7.0.0)
       railties (>= 3.2, < 5.1)
@@ -120,6 +125,8 @@ GEM
     kaminari (0.17.0)
       actionpack (>= 3.0.0)
       activesupport (>= 3.0.0)
+    kgio (2.11.4)
+    libv8 (3.16.14.19-x86_64-linux)
     loofah (2.0.3)
       nokogiri (>= 1.5.9)
     macaddr (1.7.1)
@@ -131,9 +138,12 @@ GEM
     mini_portile2 (2.1.0)
     minitest (5.10.1)
     multi_json (1.12.1)
+    mysql2 (0.4.5)
     mysql2 (0.4.5-x64-mingw32)
     nested_form (0.3.2)
     netrc (0.11.0)
+    nokogiri (1.6.8.1)
+      mini_portile2 (~> 2.1.0)
     nokogiri (1.6.8.1-x64-mingw32)
       mini_portile2 (~> 2.1.0)
     orm_adapter (0.5.0)
@@ -203,15 +213,22 @@ GEM
       activesupport (= 4.2.7.1)
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
+    raindrops (0.19.2)
     rake (11.3.0)
     rb-fsevent (0.9.8)
     rb-inotify (0.9.7)
       ffi (>= 0.5.0)
     rchardet (1.6.1)
+    redis (4.3.1)
+    ref (2.0.0)
     remotipart (1.3.1)
     request_store (1.3.1)
     responders (2.3.0)
       railties (>= 4.2.0, < 5.1)
+    rest-client (1.8.0)
+      http-cookie (>= 1.0.2, < 2.0)
+      mime-types (>= 1.16, < 3.0)
+      netrc (~> 0.7)
     rest-client (1.8.0-x64-mingw32)
       ffi (~> 1.9)
       http-cookie (>= 1.0.2, < 2.0)
@@ -241,6 +258,13 @@ GEM
       sprockets (>= 3.0.0)
     syck (1.2.0)
     systemu (2.6.5)
+    therubyracer (0.12.3)
+      libv8 (~> 3.16.14.15)
+      ref
+    thin (1.8.1)
+      daemons (~> 1.0, >= 1.0.9)
+      eventmachine (~> 1.0, >= 1.0.4)
+      rack (>= 1, < 3)
     thor (0.19.4)
     thread_safe (0.3.5)
     tilt (2.0.5)
@@ -252,7 +276,11 @@ GEM
       execjs (>= 0.3.0, < 3)
     unf (0.1.4)
       unf_ext
+    unf_ext (0.0.7.2)
     unf_ext (0.0.7.2-x64-mingw32)
+    unicorn (6.0.0)
+      kgio (~> 2.6)
+      raindrops (~> 0.7)
     uuid (2.3.8)
       macaddr (~> 1.0)
     warden (1.2.6)
@@ -260,11 +288,13 @@ GEM
     xml-simple (1.1.5)
 
 PLATFORMS
+  ruby
   x64-mingw32
 
 DEPENDENCIES
   aliyun-sdk (~> 0.4.1)
   ancestry
+  bcrypt-ruby (~> 3.0.0)
   bootstrap-sass
   cancancan
   chinese_pinyin
@@ -274,6 +304,7 @@ DEPENDENCIES
   compass
   devise
   jquery-rails
+  minitest (= 5.10.1)
   mysql2
   paper_trail (= 5.2.3)
   paperclip
@@ -282,15 +313,18 @@ DEPENDENCIES
   rails_admin
   rails_admin_import
   rails_admin_nestable
+  redis
   rest-client (~> 1.8.0)
   safe_yaml
   sass-rails
   syck
   therubyracer
+  thin
   tzinfo-data
   uglifier
+  unicorn
   uuid
   xml-simple
 
 BUNDLED WITH
-   1.13.3
+   1.16.2

+ 1 - 0
app/models/scale_user.rb

@@ -50,6 +50,7 @@ class ScaleUser < ActiveRecord::Base
 
   def get_avatar_img
     return "https://x-encrpt-bucket.s3.ap-southeast-2.amazonaws.com/encript/1766455493300.jpeg" if self.avatar.blank?
+    return self.avatar if self.avatar.to_s.start_with?('http')
     url = "http://#{Ali::Oss::CDN_URL_FOR_HOST}/#{self.avatar}"
     return url
   end