[fix](ui)(fe-system) fix fe System Info query error when the fe server run in Windows. (#20072) (#20073)
1. Fix duplicate '/' in front-end request URI. 2. When the FileSystemSeparator is '\\', replace '\\' as '/' Co-authored-by: labuladuo <labuladuo@douyu.tv>
This commit is contained in:
@ -190,6 +190,10 @@ public class SystemController extends BaseController {
|
||||
if (path == null) {
|
||||
return "/rest/v1/system";
|
||||
} else {
|
||||
final String windowsFileSystemSeparator = "\\";
|
||||
if (windowsFileSystemSeparator.equals(path.getFileSystem().getSeparator())) {
|
||||
return "/rest/v1/system?path=" + path.toString().replace("\\", "/");
|
||||
}
|
||||
return "/rest/v1/system?path=" + path.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,10 @@ function getLinkItem(text, record, index, isInner, item, hrefColumn, path){
|
||||
if (record.__hrefPaths[hrefColumn.indexOf(item)].includes('http')) {
|
||||
return <a href={record.__hrefPaths[hrefColumn.indexOf(item)]} target="_blank">{text}</a>;
|
||||
}
|
||||
return <Link to={path+(location.search?location.search:isInner)+'/'+text}>{text}</Link>;
|
||||
if (location.search[location.search.length -1] === '/') {
|
||||
return <Link to={path+location.search+text}>{text}</Link>;
|
||||
}
|
||||
return <Link to={path+(location.search?location.search:isInner)+'/'+text}>{text}</Link>;
|
||||
}
|
||||
return text === '\\N' ? '-' : text;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user