From 4fa733e7b3e85dbbc363291ef2326d170018bd6b Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Tue, 7 Mar 2023 10:08:13 +0800 Subject: [PATCH 1/2] qinluo: fix vue --- dashboard/src/router/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dashboard/src/router/index.ts b/dashboard/src/router/index.ts index eb6d726..46e1fc5 100644 --- a/dashboard/src/router/index.ts +++ b/dashboard/src/router/index.ts @@ -1,4 +1,10 @@ -import {createRouter, createWebHashHistory, NavigationGuardNext, RouteLocationNormalized} from 'vue-router' +import { + createRouter, + createWebHashHistory, + NavigationGuardNext, + RouteLocationNormalized, RouteRecordRaw, + RouterOptions +} from 'vue-router' import routes from './module/base-routes' import NProgress from 'nprogress' import 'nprogress/nprogress.css' @@ -8,7 +14,7 @@ NProgress.configure({ showSpinner: false }) const router = createRouter({ history: createWebHashHistory(), - routes + routes: routes as RouteRecordRaw[], }) /** -- Gitee From 437b6956bb850fde44a392f5ed0d2c84b551d0be Mon Sep 17 00:00:00 2001 From: qinluo <1558642210@qq.com> Date: Tue, 7 Mar 2023 16:36:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?qinluo:=20=E9=83=A8=E7=BD=B2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/components.d.ts | 8 ----- dashboard/src/api/http.ts | 2 +- dashboard/src/router/module/base-routes.ts | 2 +- .../src/views/ReportManager/trace_detail.vue | 2 +- dashboard/vite.config.ts | 16 +++++----- smart-flow-admin/pom.xml | 31 ++++++++++++++++++- .../smart/flow/admin/StartApplication.java | 2 ++ .../configuration/SmartFlowConfiguration.java | 15 ++++++++- 8 files changed, 57 insertions(+), 21 deletions(-) diff --git a/dashboard/components.d.ts b/dashboard/components.d.ts index 7815348..2b15d50 100644 --- a/dashboard/components.d.ts +++ b/dashboard/components.d.ts @@ -12,18 +12,13 @@ declare module '@vue/runtime-core' { LayBreadcrumb: typeof import('@layui/layui-vue')['LayBreadcrumb'] LayBreadcrumbItem: typeof import('@layui/layui-vue')['LayBreadcrumbItem'] LayButton: typeof import('@layui/layui-vue')['LayButton'] - LayCard: typeof import('@layui/layui-vue')['LayCard'] LayCheckbox: typeof import('@layui/layui-vue')['LayCheckbox'] LayCol: typeof import('@layui/layui-vue')['LayCol'] LayConfigProvider: typeof import('@layui/layui-vue')['LayConfigProvider'] - LayContainer: typeof import('@layui/layui-vue')['LayContainer'] - LayCountUp: typeof import('@layui/layui-vue')['LayCountUp'] LayDropdown: typeof import('@layui/layui-vue')['LayDropdown'] LayDropdownMenu: typeof import('@layui/layui-vue')['LayDropdownMenu'] LayDropdownMenuItem: typeof import('@layui/layui-vue')['LayDropdownMenuItem'] - LayField: typeof import('@layui/layui-vue')['LayField'] LayFooter: typeof import('@layui/layui-vue')['LayFooter'] - LayForm: typeof import('@layui/layui-vue')['LayForm'] LayFormItem: typeof import('@layui/layui-vue')['LayFormItem'] LayFullscreen: typeof import('@layui/layui-vue')['LayFullscreen'] LayHeader: typeof import('@layui/layui-vue')['LayHeader'] @@ -35,17 +30,14 @@ declare module '@vue/runtime-core' { LayLogo: typeof import('@layui/layui-vue')['LayLogo'] LayMenu: typeof import('@layui/layui-vue')['LayMenu'] LayMenuItem: typeof import('@layui/layui-vue')['LayMenuItem'] - LayProgress: typeof import('@layui/layui-vue')['LayProgress'] LayRow: typeof import('@layui/layui-vue')['LayRow'] LayScroll: typeof import('@layui/layui-vue')['LayScroll'] LaySide: typeof import('@layui/layui-vue')['LaySide'] - LaySpace: typeof import('@layui/layui-vue')['LaySpace'] LaySubMenu: typeof import('@layui/layui-vue')['LaySubMenu'] LaySwitch: typeof import('@layui/layui-vue')['LaySwitch'] LayTab: typeof import('@layui/layui-vue')['LayTab'] LayTabItem: typeof import('@layui/layui-vue')['LayTabItem'] LayTable: typeof import('@layui/layui-vue')['LayTable'] - LayTextarea: typeof import('@layui/layui-vue')['LayTextarea'] LayTooltip: typeof import('@layui/layui-vue')['LayTooltip'] LayTransition: typeof import('@layui/layui-vue')['LayTransition'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/dashboard/src/api/http.ts b/dashboard/src/api/http.ts index 8948731..0b43443 100644 --- a/dashboard/src/api/http.ts +++ b/dashboard/src/api/http.ts @@ -10,7 +10,7 @@ type TAxiosOption = { const config: TAxiosOption = { timeout: 5000, - baseURL: "http://localhost:8076" + baseURL: "" } class Http { diff --git a/dashboard/src/router/module/base-routes.ts b/dashboard/src/router/module/base-routes.ts index fce91c6..251b5a9 100644 --- a/dashboard/src/router/module/base-routes.ts +++ b/dashboard/src/router/module/base-routes.ts @@ -5,7 +5,7 @@ import Login from '../../views/login/index.vue'; export default [ { path: '/', - redirect: '/engines' + redirect: '/engines/engines-list' }, { component: BaseLayout, diff --git a/dashboard/src/views/ReportManager/trace_detail.vue b/dashboard/src/views/ReportManager/trace_detail.vue index 5ab68ca..4b90fda 100644 --- a/dashboard/src/views/ReportManager/trace_detail.vue +++ b/dashboard/src/views/ReportManager/trace_detail.vue @@ -79,7 +79,7 @@
- + diff --git a/dashboard/vite.config.ts b/dashboard/vite.config.ts index f590b8d..3d8b549 100644 --- a/dashboard/vite.config.ts +++ b/dashboard/vite.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ server:{ proxy:{ '/api': { - target: 'http://localhost:18083/api/', + target: 'http://localhost:8076/api/', changeOrigin: true, rewrite: path => path.replace(/^\/api/, '') } @@ -32,13 +32,13 @@ export default defineConfig({ }), ], }), - visualizer({ - emitFile: true, - filename: "visualizer.html", - gzipSize: true, - brotliSize: true, - open: true, - }), + // visualizer({ + // emitFile: true, + // filename: "visualizer.html", + // gzipSize: true, + // brotliSize: true, + // open: true, + // }), vue(), ], }); \ No newline at end of file diff --git a/smart-flow-admin/pom.xml b/smart-flow-admin/pom.xml index 2c76a86..cc8b1a2 100644 --- a/smart-flow-admin/pom.xml +++ b/smart-flow-admin/pom.xml @@ -62,7 +62,7 @@ 1.1.8 - + net.sourceforge.plantuml plantuml @@ -74,4 +74,33 @@ + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.0.0 + + + + org.smartboot.smart.flow.admin.StartApplication + + + + jar-with-dependencies + + + + + make-assembly + package + + single + + + + + + + \ No newline at end of file diff --git a/smart-flow-admin/src/main/java/org/smartboot/smart/flow/admin/StartApplication.java b/smart-flow-admin/src/main/java/org/smartboot/smart/flow/admin/StartApplication.java index b595e46..e980fea 100644 --- a/smart-flow-admin/src/main/java/org/smartboot/smart/flow/admin/StartApplication.java +++ b/smart-flow-admin/src/main/java/org/smartboot/smart/flow/admin/StartApplication.java @@ -3,6 +3,7 @@ package org.smartboot.smart.flow.admin; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; /** * @author qinluo @@ -11,6 +12,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; */ @SpringBootApplication(scanBasePackages = {"org.smartboot.smart.flow.admin"}) @MapperScan("org.smartboot.smart.flow.admin.mapper") +@EnableWebMvc public class StartApplication { public static void main(String[] args) { diff --git a/smart-flow-admin/src/main/java/org/smartboot/smart/flow/admin/configuration/SmartFlowConfiguration.java b/smart-flow-admin/src/main/java/org/smartboot/smart/flow/admin/configuration/SmartFlowConfiguration.java index 4784aac..42c10a6 100644 --- a/smart-flow-admin/src/main/java/org/smartboot/smart/flow/admin/configuration/SmartFlowConfiguration.java +++ b/smart-flow-admin/src/main/java/org/smartboot/smart/flow/admin/configuration/SmartFlowConfiguration.java @@ -6,6 +6,9 @@ import org.springframework.context.annotation.Configuration; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * @author qinluo @@ -13,7 +16,17 @@ import org.springframework.web.filter.CorsFilter; * @since 1.0.0 */ @Configuration -public class SmartFlowConfiguration { +public class SmartFlowConfiguration implements WebMvcConfigurer { + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); + } + + @Override + public void addViewControllers(ViewControllerRegistry registry) { + registry.addRedirectViewController("/", "/index.html"); + } @Bean public FilterRegistrationBean getCorsFilter() { -- Gitee