From f2c6fbb452b3de67c7af5eb9752b46b9f9890d37 Mon Sep 17 00:00:00 2001 From: songjianet <1778651752@qq.com> Date: Tue, 1 Mar 2022 11:18:25 +0800 Subject: [PATCH] [Fix][UI Next] Fix build standalone error. (#8590) --- dolphinscheduler-ui-next/.env.production | 2 +- dolphinscheduler-ui-next/src/router/index.ts | 4 +++- .../projects/task/components/node/fields/use-procedure.ts | 4 +++- dolphinscheduler-ui-next/vite.config.ts | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-ui-next/.env.production b/dolphinscheduler-ui-next/.env.production index 74bc29d2e3..683b8c3aab 100644 --- a/dolphinscheduler-ui-next/.env.production +++ b/dolphinscheduler-ui-next/.env.production @@ -15,4 +15,4 @@ NODE_ENV=production -VITE_APP_PROD_WEB_URL='' +VITE_APP_PROD_WEB_URL='http://127.0.0.1:12345' diff --git a/dolphinscheduler-ui-next/src/router/index.ts b/dolphinscheduler-ui-next/src/router/index.ts index 7ee130ce43..b905b6e044 100644 --- a/dolphinscheduler-ui-next/src/router/index.ts +++ b/dolphinscheduler-ui-next/src/router/index.ts @@ -32,7 +32,9 @@ import NProgress from 'nprogress' import 'nprogress/nprogress.css' const router = createRouter({ - history: createWebHistory(), + history: createWebHistory( + import.meta.env.MODE === 'production' ? '/dolphinscheduler/ui/' : '/' + ), routes }) diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-procedure.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-procedure.ts index d0fbd12204..b4e0a3f5cb 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-procedure.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-procedure.ts @@ -28,7 +28,9 @@ export function useProcedure(model: { [field: string]: any }): IJsonItem[] { props: { language: 'sql', placeholder: t('project.node.procedure_method_tips'), - defaultValue: model.method? model.method : t('project.node.procedure_method_snippet') + defaultValue: model.method + ? model.method + : t('project.node.procedure_method_snippet') }, validate: { trigger: ['input', 'trigger'], diff --git a/dolphinscheduler-ui-next/vite.config.ts b/dolphinscheduler-ui-next/vite.config.ts index 019618e75b..1988ee8072 100644 --- a/dolphinscheduler-ui-next/vite.config.ts +++ b/dolphinscheduler-ui-next/vite.config.ts @@ -22,7 +22,7 @@ import viteCompression from 'vite-plugin-compression' import path from 'path' export default defineConfig({ - base: process.env.NODE_ENV === 'production' ? './' : '/', + base: process.env.NODE_ENV === 'production' ? '/dolphinscheduler/ui/' : '/', plugins: [ vue(), vueJsx(),