Commit 1a6c45c 1 parent 4d368a4 commit 1a6c45c Copy full SHA for 1a6c45c
File tree 3 files changed +13
-0
lines changed
views/host/file-management
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export const GlobalStore = defineStore({
26
26
hasNewVersion : false ,
27
27
ignoreCaptcha : true ,
28
28
device : DeviceType . Desktop ,
29
+ lastFilePath : '' ,
29
30
} ) ,
30
31
getters : { } ,
31
32
actions : {
@@ -60,6 +61,9 @@ export const GlobalStore = defineStore({
60
61
isMobile ( ) {
61
62
return this . device === DeviceType . Mobile ;
62
63
} ,
64
+ setLastFilePath ( path : string ) {
65
+ this . lastFilePath = path ;
66
+ } ,
63
67
} ,
64
68
persist : piniaPersistConfig ( 'GlobalState' ) ,
65
69
} ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export interface GlobalState {
21
21
hasNewVersion : boolean ;
22
22
ignoreCaptcha : boolean ;
23
23
device : DeviceType ;
24
+ lastFilePath : string ;
24
25
}
25
26
26
27
export interface MenuState {
Original file line number Diff line number Diff line change @@ -363,6 +363,8 @@ const jump = async (url: string) => {
363
363
req .containSub = false ;
364
364
req .search = ' ' ;
365
365
let searchResult = await searchFile ();
366
+
367
+ globalStore .setLastFilePath (req .path );
366
368
// check search result,the file is exists?
367
369
if (! searchResult .data .path ) {
368
370
req .path = oldUrl ;
@@ -636,6 +638,12 @@ onMounted(() => {
636
638
if (router .currentRoute .value .query .path ) {
637
639
req .path = String (router .currentRoute .value .query .path );
638
640
getPaths (req .path );
641
+ globalStore .setLastFilePath (req .path );
642
+ } else {
643
+ if (globalStore .lastFilePath && globalStore .lastFilePath != ' ' ) {
644
+ req .path = globalStore .lastFilePath ;
645
+ getPaths (req .path );
646
+ }
639
647
}
640
648
pathWidth .value = pathRef .value .offsetWidth * 0.7 ;
641
649
search ();
You can’t perform that action at this time.
0 commit comments