|
|
@@ -1,43 +1,40 @@
|
|
|
const proxy = require('express-http-proxy')
|
|
|
|
|
|
-const use = false
|
|
|
+const use = true
|
|
|
|
|
|
const base_url = process.env.VUE_APP_BASE_API
|
|
|
const minioKey = process.env.VUE_APP_MINIO.replace(base_url, '')
|
|
|
const thumbnailKey = process.env.VUE_APP_THUMBNAIL.replace(base_url, '')
|
|
|
|
|
|
-const minio_url = 'http://10.180.88.84:9000'
|
|
|
-const thumbnail_url = 'http://isoc.artaplay.com:8082'
|
|
|
+const ui = 'http://10.180.88.84:8093'
|
|
|
const gate = 'http://10.180.88.84:8081'
|
|
|
|
|
|
module.exports = {
|
|
|
register (router) {
|
|
|
if (use) {
|
|
|
router.use('/auth', createProxy(process.env.VUE_APP_KEYCLOAK_OPTIONS_URL))
|
|
|
- router.use(minioKey, createProxy(minio_url))
|
|
|
- router.use(thumbnailKey, createThumbnailProxy(thumbnail_url))
|
|
|
- // router.use('/minio-data', createProxy('http://10.180.90.6:18888', true))
|
|
|
- // router.use('/item', createProxy('http://10.180.90.6:18887', true))
|
|
|
- // router.use('/scheduling', createProxy('http://10.180.90.6:18887', true))
|
|
|
- // router.use('/scheduling-config', createProxy('http://10.180.90.6:18887', true))
|
|
|
- // router.use('/scheduling-plugin-device', createProxy('http://10.180.90.6:18887', true))
|
|
|
- // router.use('/release-history', createProxy('http://10.180.90.6:18887', true))
|
|
|
- // router.use('/apkUpgradeFile', createProxy('http://10.180.90.6:8889', true))
|
|
|
- // router.use('/apkUpgradePolicy', createProxy('http://10.180.90.6:8889', true))
|
|
|
- // router.use('/device', createProxy('http://10.180.90.27:8891', true))
|
|
|
- // router.use('/sysLog', createProxy('http://10.180.91.61:8890', true))
|
|
|
- // router.use('/minio-data', createProdProxy('http://10.180.88.84:8094'))
|
|
|
+ router.use(minioKey, createProxy(`${ui}`))
|
|
|
+ router.use(thumbnailKey, createThumbnailProxy(`${ui}`))
|
|
|
+ // router.use('/minio-data', createProxy('http://10.180.90.6:18888'))
|
|
|
+ // router.use('/item', createProxy('http://10.180.90.6:18887'))
|
|
|
+ // router.use('/scheduling', createProxy('http://10.180.90.6:18887'))
|
|
|
+ // router.use('/scheduling-config', createProxy('http://10.180.90.6:18887'))
|
|
|
+ // router.use('/scheduling-plugin-device', createProxy('http://10.180.90.6:18887'))
|
|
|
+ // router.use('/release-history', createProxy('http://10.180.90.6:18887'))
|
|
|
+ // router.use('/apkUpgradeFile', createProxy('http://10.180.90.6:8889'))
|
|
|
+ // router.use('/apkUpgradePolicy', createProxy('http://10.180.90.6:8889'))
|
|
|
+ // router.use('/device', createProxy('http://10.180.90.27:8891'))
|
|
|
+ // router.use('/sysLog', createProxy('http://10.180.91.61:8890'))
|
|
|
// router.use('/content', createProxy('http://liangke00.home.langchao.com:8081'))
|
|
|
- // router.use('/content', createProxy('http://10.180.90.13:8887', true))
|
|
|
- // router.use('/', createProxy('http://liangke00.home.langchao.com:8081'))
|
|
|
- // router.use('/content', createProxy('http://liangke00.home.langchao.com:8081', true))
|
|
|
- // router.use('/orchestration', createProxy('http://liangke00.home.langchao.com:8081', true))
|
|
|
- router.use('/', createProxy(gate))
|
|
|
+ // router.use('/content', createProxy('http://10.180.90.13:8887'))
|
|
|
+ // router.use('/content', createProxy('http://liangke00.home.langchao.com:8081'))
|
|
|
+ // router.use('/orchestration', createProxy('http://liangke00.home.langchao.com:8081'))
|
|
|
+ router.use('/', createProxy(gate, false))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function createProxy (to, replace) {
|
|
|
+function createProxy (to, replace = true) {
|
|
|
return proxy(to, {
|
|
|
parseReqBody: false,
|
|
|
proxyReqPathResolver (req) {
|
|
|
@@ -48,22 +45,11 @@ function createProxy (to, replace) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-function createProdProxy (to) {
|
|
|
- return proxy(to, {
|
|
|
- parseReqBody: false,
|
|
|
- proxyReqPathResolver (req) {
|
|
|
- const url = `/prod-api${req.baseUrl.replace(base_url, '')}${req.url}`
|
|
|
- console.log(`proxy ${url} to ${to}`)
|
|
|
- return url
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
function createThumbnailProxy (to) {
|
|
|
return proxy(to, {
|
|
|
parseReqBody: false,
|
|
|
proxyReqPathResolver (req) {
|
|
|
- const url = req.url.replace(new RegExp(`http.*${minioKey}`), minio_url)
|
|
|
+ const url = `${thumbnailKey}${req.url.replace(new RegExp(`http.*${minioKey}`), `${ui}${minioKey}`)}`
|
|
|
console.log(`thumbnail ${url} to ${to}`)
|
|
|
return url
|
|
|
}
|