diff --git a/tiesheng-util/src/main/java/com/tiesheng/util/config/GlobalConfig.java b/tiesheng-util/src/main/java/com/tiesheng/util/config/GlobalConfig.java index 61a59e9..e682ab8 100644 --- a/tiesheng-util/src/main/java/com/tiesheng/util/config/GlobalConfig.java +++ b/tiesheng-util/src/main/java/com/tiesheng/util/config/GlobalConfig.java @@ -1,5 +1,6 @@ package com.tiesheng.util.config; +import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.spring.SpringUtil; import cn.hutool.log.LogFactory; @@ -66,10 +67,12 @@ public class GlobalConfig { if (resources.length == 0) { throw new ApiException("无法重定向,请检查资源"); } - String filename = resources[resources.length - 1].getFile().getPath(); + String filename = resources[resources.length - 1].getURL().getPath(); + filename = FileUtil.normalize(filename); String path = buildPath(String.format("/%s%s#%s", htmlDir, StrUtil.subAfter(filename, htmlDir, true), route)); response.sendRedirect(path); - } catch (IOException ignored) { + } catch (IOException e) { + LogFactory.get().info(e); } }