diff --git a/app.platform/src/main/resources/META-INF/platform/plugins/frontend-module.json b/app.platform/src/main/resources/META-INF/platform/plugins/frontend-module.json new file mode 100644 index 00000000..8eadc4af --- /dev/null +++ b/app.platform/src/main/resources/META-INF/platform/plugins/frontend-module.json @@ -0,0 +1,11 @@ +{ + "name": "app.platform", + "components": [ + ], + "resources": [ + "/public/configure.js", + "/public/favicon.svg", + "/public/login-bg.jpg", + "/public/logo.svg" + ] +} \ No newline at end of file diff --git a/app.platform/src/main/resources/public/configure.js b/app.platform/src/main/resources/public/configure.js new file mode 100644 index 00000000..b4485e6f --- /dev/null +++ b/app.platform/src/main/resources/public/configure.js @@ -0,0 +1,7 @@ +window.APP = {}; // 在浏览器 window 对象中新建名为 APP 的变量, 用于存放应用对象的容器 +window.APP.configure ={ // 全局配置存储容器 + webContextPath: '[(@{/})]'.startsWith('[')? '/' : '[(@{/})]', // 应用上下文路径 + apiContextPaths: { + DEFAULT: '[(@{/})]'.startsWith('[') ? 'http://localhost:8080/' : '[(@{/})]', // 后端 API 请求的服务地址前缀 + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 62ddadd9..46346189 100644 --- a/build.gradle +++ b/build.gradle @@ -366,6 +366,31 @@ subprojects { } } + /*----------------------------------------------------------------- + * pnpm sync + *----------------------------------------------------------------*/ + task frontendNpmSync(type:Exec){ + if(isFrontendProject(file('.')) && !project.name.contains("io.sc.platform.security.frontend")){ + workingDir '.' + if(org.gradle.internal.os.OperatingSystem.current().isWindows()){ + commandLine 'cmd', '/c', 'pnpm', 'sync' + }else{ + commandLine 'pnpm', 'sync' + } + }else{ + if(org.gradle.internal.os.OperatingSystem.current().isWindows()){ + commandLine 'cmd', '/c', 'cd', '.' + }else{ + commandLine 'cd', '.' + } + } + } + tasks.frontendNpmSync.doFirst { + if(isFrontendProject(file('.'))) { + println '开始执行 pnpm sync ......'; + } + } + /*----------------------------------------------------------------- * pnpm run build *----------------------------------------------------------------*/ @@ -554,13 +579,34 @@ subprojects { //resources---------------------------------------- List resources = new ArrayList(); def dirPath = file('dist').absolutePath; - def tree = fileTree('dist') { - include '**/*.*' - } - tree.each { File file -> - resources.add(file.absolutePath.substring(dirPath.length())); + if(project.name.contains('io.sc.platform.mvc.frontend')){ + def tree = fileTree('dist') { + include '**/*.*' + exclude "public/${project.name}/configure.js" + exclude "public/${project.name}/favicon.svg" + exclude "public/${project.name}/index.html" + exclude "public/${project.name}/login-bg.jpg" + exclude "public/${project.name}/logo.svg" + } + tree.each { File file -> + resources.add(file.absolutePath.substring(dirPath.length())); + } + }else{ + def tree = fileTree('dist') { + include '**/*.*' + exclude '**/webjars/**/*.*' + exclude "public/${project.name}/configure.js" + exclude "public/${project.name}/favicon.svg" + exclude "public/${project.name}/index.html" + exclude "public/${project.name}/login-bg.jpg" + exclude "public/${project.name}/logo.svg" + } + tree.each { File file -> + resources.add(file.absolutePath.substring(dirPath.length())); + } } + //all-in-one------------------------------------ Map allInOne =new LinkedHashMap<>(); allInOne.put("name",project.name); @@ -587,7 +633,8 @@ subprojects { // 定义前端构建任务的依赖及执行顺序 frontendNpmInstall.dependsOn(frontendUpdatePackageJson) - frontendNpmBuild.dependsOn(frontendNpmInstall) + frontendNpmSync.dependsOn(frontendNpmInstall) + frontendNpmBuild.dependsOn(frontendNpmSync) frontendNpmProd.dependsOn(frontendNpmInstall) // 资源处理前进行前端模块的构建 diff --git a/gradle.properties b/gradle.properties index ce62da30..677f53c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,9 +36,9 @@ application_version=1.0.0 # platform ########################################################### platform_group=io.sc -platform_version=8.1.9 -platform_plugin_version=8.1.8 -platform_core_frontend_version=8.1.16 +platform_version=8.1.11 +platform_plugin_version=8.1.11 +platform_core_frontend_version=8.1.27 ########################################################### # dependencies version @@ -73,7 +73,7 @@ spring_cloud_version=2021.0.8 spring_security_oauth2_authorization_server_version=0.4.4 spring_statemachine_version=3.2.1 webjars_locator_weblogic_version=0.10 -zip4j_version=2.9.1 +zip4j_version=2.11.5 ########################################################### # asciidoc deploy directory,the path must end with '/' diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index 971687f4..646308e2 100644 --- a/io.sc.platform.core.frontend/package.json +++ b/io.sc.platform.core.frontend/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.17", + "version": "8.1.28", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", @@ -96,9 +96,22 @@ "webpack-merge": "5.10.0" }, "dependencies": { + "@codemirror/autocomplete": "6.11.1", + "@codemirror/commands": "6.3.2", + "@codemirror/lang-html": "6.4.7", + "@codemirror/lang-java": "6.0.1", + "@codemirror/lang-javascript": "6.2.1", + "@codemirror/lang-json": "6.0.1", + "@codemirror/lang-sql": "6.5.4", + "@codemirror/lang-xml": "6.0.2", + "@codemirror/language": "6.9.3", + "@codemirror/search": "6.5.5", + "@codemirror/state": "6.3.3", + "@codemirror/view": "6.22.1", "@quasar/extras": "1.16.7", "@vueuse/core": "10.3.0", "axios": "1.5.1", + "codemirror": "6.0.1", "dayjs": "1.11.10", "echarts": "5.4.1", "exceljs": "4.3.0", @@ -109,6 +122,7 @@ "quasar": "2.13.0", "tailwindcss": "3.3.5", "vue": "3.3.7", + "vue-codemirror6": "1.1.31", "vue-dompurify-html": "4.1.4", "vue-i18n": "9.6.0", "vue-router": "4.2.5" diff --git a/io.sc.platform.core.frontend/public/index.html b/io.sc.platform.core.frontend/public/index.html index 54ac9438..bc996180 100644 --- a/io.sc.platform.core.frontend/public/index.html +++ b/io.sc.platform.core.frontend/public/index.html @@ -6,10 +6,10 @@ - - - - + + + + @@ -18,31 +18,7 @@ - +