mirror of
https://gitee.com/blossom-editor/blossom.git
synced 2025-12-06 08:48:29 +08:00
博客的前端以jar包形式导入到后台服务
This commit is contained in:
parent
8839af682b
commit
853c6866f6
@ -17,6 +17,11 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.blossom</groupId>
|
||||
<artifactId>blossom-web</artifactId>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.blossom</groupId>
|
||||
|
||||
@ -12,9 +12,7 @@ import org.springframework.core.env.Environment;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.*;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
@ -82,7 +80,24 @@ public class WebConfigurer implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(userTypeInterceptor()).addPathPatterns("/**");
|
||||
registry.addInterceptor(userTypeInterceptor())
|
||||
.addPathPatterns("/**")
|
||||
.excludePathPatterns(
|
||||
"/blog/**",
|
||||
"/assets/**"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/blog/").setViewName("/blog/index.html");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/blog/**").addResourceLocations("classpath:/META-INF/resources/webjars/blossom-web/");
|
||||
registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/META-INF/resources/webjars/blossom-web/assets/");
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@ -51,6 +51,7 @@ project:
|
||||
- /sentinel/**
|
||||
- /editor/**
|
||||
- /blog/**
|
||||
- /assets/**
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ Cache/Redis ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
cache: # 缓存
|
||||
names-config: # 缓存键超时时间配置
|
||||
@ -76,3 +77,6 @@ project:
|
||||
domain: "http://localhost:9999/pic/"
|
||||
# 请以 / 开头, / 结尾, 简短的路径在文章中有更好的显示效果, 过长一定程度会使文章内容混乱
|
||||
default-path: "/home/bl/img/"
|
||||
server:
|
||||
servlet:
|
||||
context-path: /dev
|
||||
@ -49,6 +49,8 @@ project:
|
||||
multi-place-login: true # 客户端是否允许多地登录
|
||||
white-list: # 白名单
|
||||
- /sentinel/**
|
||||
- /blog/**
|
||||
- /assets/**
|
||||
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ Cache/Redis ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
cache: # 缓存
|
||||
names-config: # 缓存键超时时间配置
|
||||
|
||||
1
blossom-web/.env
Normal file
1
blossom-web/.env
Normal file
@ -0,0 +1 @@
|
||||
VITE_BLOSSOM_BASE_URI=/
|
||||
1
blossom-web/.env.development
Normal file
1
blossom-web/.env.development
Normal file
@ -0,0 +1 @@
|
||||
VITE_BLOSSOM_BASE_URI=/dev
|
||||
1
blossom-web/.gitignore
vendored
1
blossom-web/.gitignore
vendored
@ -9,6 +9,7 @@ lerna-debug.log*
|
||||
stats.html
|
||||
|
||||
node_modules
|
||||
target
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
|
||||
73
blossom-web/pom.xml
Normal file
73
blossom-web/pom.xml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.blossom</groupId>
|
||||
<artifactId>blossom-web</artifactId>
|
||||
<version>1.10.0-SNAPSHOT</version>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>github</id>
|
||||
<name>GitHub MetaCode Apache Maven Packages</name>
|
||||
<url>https://maven.pkg.github.com/metacode-project/metacode-maven-packages</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.github.eirslett</groupId>
|
||||
<artifactId>frontend-maven-plugin</artifactId>
|
||||
<!-- NB! Set <version> to the latest released version of frontend-maven-plugin, like in README.md -->
|
||||
<version>1.14.0</version>
|
||||
<configuration>
|
||||
<installDirectory>target</installDirectory>
|
||||
<nodeVersion>v16.13.1</nodeVersion>
|
||||
<yarnVersion>v1.22.19</yarnVersion>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>install node and yarn</id>
|
||||
<goals>
|
||||
<goal>install-node-and-yarn</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>yarn config set registry</id>
|
||||
<goals>
|
||||
<goal>yarn</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>yarn install</id>
|
||||
<goals>
|
||||
<goal>yarn</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>install</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>yarn build</id>
|
||||
<goals>
|
||||
<goal>yarn</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>build</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>dist</directory>
|
||||
<targetPath>META-INF/resources/webjars/blossom-web</targetPath>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -34,7 +34,7 @@ const blossom = {
|
||||
*/
|
||||
DOMAIN: {
|
||||
// 将该值填写为你的后台访问地址, 与 blossom 客户端登录页面填写的地址相同
|
||||
PRD: 'https://www.wangyunf.com/bl/',
|
||||
PRD: import.meta.env.VITE_BLOSSOM_BASE_URI,
|
||||
// 将该值填写你开放为博客的用户ID
|
||||
USER_ID: 1
|
||||
},
|
||||
|
||||
@ -16,6 +16,12 @@ export default defineConfig({
|
||||
base: './',
|
||||
server: {
|
||||
host: "0.0.0.0",
|
||||
// 开发环境代理
|
||||
proxy: {
|
||||
'/dev': {
|
||||
target:'http://127.0.0.1:9999/',
|
||||
},
|
||||
},
|
||||
port: 5174,
|
||||
//vue3 vite配置热更新不用手动刷新
|
||||
hmr: true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user