fix: 解决文件搜索不存在的资源后,点击下面存在的目录也会提示资源不存在的问题 (#896)

This commit is contained in:
zhengkunwang223 2023-05-06 13:49:33 +07:00 committed by GitHub
parent 4f168656fc
commit 28ebf7a0cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -356,6 +356,7 @@ const back = () => {
};
const jump = async (url: string) => {
const oldUrl = req.path;
// reset search params before exec jump
Object.assign(req, initData());
req.path = url;
@ -364,6 +365,7 @@ const jump = async (url: string) => {
let searchResult = await searchFile();
// check search result,the file is exists?
if (!searchResult.data.path) {
req.path = oldUrl;
MsgWarning(i18n.global.t('commons.res.notFound'));
return;
}