Merge branches 'develop' and 'develop' of https://gitee.com/likeshop_gitee/likeadmin-java into develop

This commit is contained in:
Jason 2022-08-17 16:14:37 +08:00
commit ac721f4529
4 changed files with 7 additions and 22 deletions

View File

@ -1,18 +0,0 @@
package com.hxkj.admin.config;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
@Component
public class ErrorPageConfig implements ErrorPageRegistrar {
@Override
public void registerErrorPages(ErrorPageRegistry registry) {
ErrorPage error404Page=new ErrorPage(HttpStatus.NOT_FOUND,"/index.html" );
registry.addErrorPages(error404Page);
}
}

View File

@ -11,7 +11,7 @@ spring:
profiles:
active: pro
mvc:
static-path-pattern: /static/**
static-path-pattern: /api/static/**
# 数据源配置
datasource:
url: jdbc:mysql://localhost:3306/local_admin_java?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false

View File

@ -24,7 +24,7 @@ public class GlobalConfig {
public static String redisPrefix = "Like:";
// 资源访问前缀
public static String publicPrefix = "uploads";
public static String publicPrefix = "api/uploads";
// 上传映射目录
public static String uploadDirectory = "/www/like-admin/uploads/";

View File

@ -32,7 +32,7 @@ public class UrlUtil {
url = "/" + url;
}
if (url.startsWith("/static/")) {
if (url.startsWith("/api/static/")) {
return RequestUtil.uri() + url;
}
@ -94,7 +94,10 @@ public class UrlUtil {
}
Map<String, String> config = ConfigUtil.getMap("storage", engine);
return config.getOrDefault("domain", "") + "/";
if (config != null) {
return config.getOrDefault("domain", "") + "/";
}
return "";
}
}