Merge branches 'develop' and 'develop' of https://gitee.com/likeshop_gitee/likeadmin-java into develop
This commit is contained in:
commit
ac721f4529
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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/";
|
||||
|
|
|
|||
|
|
@ -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 "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue