Browse Source

feat: thumbnail service intranet OSS address configuration

Casper Dai 3 years ago
parent
commit
0d56288c86
2 changed files with 2 additions and 1 deletions
  1. 1 0
      .env
  2. 1 1
      src/api/asset.js

+ 1 - 0
.env

@@ -29,6 +29,7 @@ VUE_APP_MINIO = '/oss-api'
 
 # thumbnail
 VUE_APP_THUMBNAIL = '/api/imageproxy'
+VUE_APP_THUMBNAIL_ORIGIN = ''
 
 # keycloak
 VUE_APP_KEYCLOAK_OPTIONS_URL = '/auth'

+ 1 - 1
src/api/asset.js

@@ -75,7 +75,7 @@ export function getThumbnailUrl (item, option) {
     option = getImageProxyOption(option)
   }
   if (url.charAt(0) === '/') {
-    url = `${location.origin}${url}`
+    url = `${process.env.VUE_APP_THUMBNAIL_ORIGIN || location.origin}${url}`
   }
   return `${process.env.VUE_APP_THUMBNAIL}/${option}/${url}`
 }