|
@@ -9,7 +9,7 @@ const base_url = process.env.VUE_APP_BASE_API
|
|
|
const minioKey = process.env.VUE_APP_MINIO.replace(base_url, '')
|
|
const minioKey = process.env.VUE_APP_MINIO.replace(base_url, '')
|
|
|
const thumbnailKey = process.env.VUE_APP_THUMBNAIL.replace(base_url, '')
|
|
const thumbnailKey = process.env.VUE_APP_THUMBNAIL.replace(base_url, '')
|
|
|
|
|
|
|
|
-const isHttps = !/^[0-9.:]+$/.test(gate)
|
|
|
|
|
|
|
+const isHttps = url => !/^[0-9.:]+$/.test(url)
|
|
|
|
|
|
|
|
module.exports = {
|
|
module.exports = {
|
|
|
register (router) {
|
|
register (router) {
|
|
@@ -24,7 +24,7 @@ module.exports = {
|
|
|
|
|
|
|
|
function createProxy (to, replace) {
|
|
function createProxy (to, replace) {
|
|
|
return proxy(to, {
|
|
return proxy(to, {
|
|
|
- https: isHttps,
|
|
|
|
|
|
|
+ https: isHttps(to),
|
|
|
parseReqBody: false,
|
|
parseReqBody: false,
|
|
|
proxyReqPathResolver (req) {
|
|
proxyReqPathResolver (req) {
|
|
|
const url = replace ? `${replace}${req.url}` : req.url
|
|
const url = replace ? `${replace}${req.url}` : req.url
|
|
@@ -36,7 +36,7 @@ function createProxy (to, replace) {
|
|
|
|
|
|
|
|
function createThumbnailProxy (to) {
|
|
function createThumbnailProxy (to) {
|
|
|
return proxy(to, {
|
|
return proxy(to, {
|
|
|
- https: isHttps,
|
|
|
|
|
|
|
+ https: isHttps(to),
|
|
|
parseReqBody: false,
|
|
parseReqBody: false,
|
|
|
proxyReqPathResolver (req) {
|
|
proxyReqPathResolver (req) {
|
|
|
const url = `${thumbnailKey}${req.url.replace(new RegExp(`http.*${minioKey}`), `http${isHttps ? 's' : ''}://${gate}${minioKey}`)}`
|
|
const url = `${thumbnailKey}${req.url.replace(new RegExp(`http.*${minioKey}`), `http${isHttps ? 's' : ''}://${gate}${minioKey}`)}`
|