diff --git a/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java b/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java index bebb41227d..ce541e1d53 100644 --- a/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java +++ b/core/core-backend/src/main/java/io/dataease/home/RestIndexController.java @@ -2,6 +2,7 @@ package io.dataease.home; import io.dataease.utils.ModelUtils; import io.dataease.utils.RsaUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -11,6 +12,9 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping public class RestIndexController { + @Value("${dataease.xpack-front-distributed:false}") + private boolean xpackFrontDistributed; + @GetMapping("/dekey") @ResponseBody public String dekey() { @@ -23,4 +27,11 @@ public class RestIndexController { return ModelUtils.isDesktop(); } + + @GetMapping("/xpackModel") + @ResponseBody + public boolean xpackModel() { + return xpackFrontDistributed; + } + } diff --git a/core/core-frontend/src/api/plugin.ts b/core/core-frontend/src/api/plugin.ts index 5eef5c9ca1..b708650759 100644 --- a/core/core-frontend/src/api/plugin.ts +++ b/core/core-frontend/src/api/plugin.ts @@ -1,3 +1,7 @@ import request from '@/config/axios' export const load = (key: string) => request.get({ url: `/xpackComponent/content/${key}` }) + +export const loadDistributed = () => request.get({ url: '/DEXPack.umd.js' }) + +export const xpackModelApi = () => request.get({ url: '/xpackModel' }) diff --git a/core/core-frontend/src/components/plugin/src/index.vue b/core/core-frontend/src/components/plugin/src/index.vue index e2825f2eeb..6197cca108 100644 --- a/core/core-frontend/src/components/plugin/src/index.vue +++ b/core/core-frontend/src/components/plugin/src/index.vue @@ -1,10 +1,9 @@