File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
MDriveSync.Client.API/Controllers Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ public Result<List<JobConfig>> GetJobs()
104104 j . Metadata ??= new ( ) ;
105105 j . Metadata . Message = c . ProcessMessage ;
106106 j . IsMount = c . DriveIsMount ( ) ;
107+
107108 return j ;
108109 } ) . ToList ( ) ;
109110 return Result . Ok ( data ) ;
Original file line number Diff line number Diff line change @@ -327,6 +327,17 @@ public void DriveJobMount(string jobId)
327327
328328 if ( _jobs . TryGetValue ( jobId , out var job ) || job != null )
329329 {
330+ if ( string . IsNullOrEmpty ( job . CurrrentJob ? . MountConfig ? . MountPoint ) )
331+ {
332+ throw new LogicException ( "请选择或输入挂载点" ) ;
333+ }
334+
335+ var pints = Filesystem . GetAvailableMountPoints ( ) . ToList ( ) ;
336+ if ( pints . Count > 0 && ! pints . Contains ( job . CurrrentJob ? . MountConfig ? . MountPoint ) )
337+ {
338+ throw new LogicException ( "选择的挂载点不存在或被占用,不允许挂载" ) ;
339+ }
340+
330341 job . DriveMount ( ) ;
331342 }
332343 }
@@ -370,6 +381,12 @@ public void DriveMount(string driveId)
370381 throw new LogicException ( "请选择或输入挂载点" ) ;
371382 }
372383
384+ var pints = Filesystem . GetAvailableMountPoints ( ) . ToList ( ) ;
385+ if ( pints . Count > 0 && ! pints . Contains ( drive . MountConfig . MountPoint ) )
386+ {
387+ throw new LogicException ( "选择的挂载点不存在或被占用,不允许挂载" ) ;
388+ }
389+
373390 if ( ! _mounter . TryGetValue ( drive . Id , out var mt ) || mt == null )
374391 {
375392 mt = new AliyunDriveMounter ( drive , drive . MountConfig ) ;
You can’t perform that action at this time.
0 commit comments