File tree Expand file tree Collapse file tree
src/pages/preference/components/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,17 +14,21 @@ import { join } from '@/utils/path'
1414const modelStore = useModelStore ()
1515
1616async function handleDelete(item : Model ) {
17- const { id, path } = item
17+ try {
18+ const { id, path } = item
1819
19- await remove (path , { recursive: true })
20+ await remove (path , { recursive: true })
2021
21- modelStore .models = modelStore .models .filter (item => item .id !== id )
22+ modelStore .models = modelStore .models .filter (item => item .id !== id )
2223
23- if (id === modelStore .currentModel ?.id ) {
24- modelStore .currentModel = modelStore .models [0 ]
25- }
24+ if (id === modelStore .currentModel ?.id ) {
25+ modelStore .currentModel = modelStore .models [0 ]
26+ }
2627
27- message .success (' 删除成功' )
28+ message .success (' 删除成功' )
29+ } catch (error ) {
30+ message .error (String (error ))
31+ }
2832}
2933 </script >
3034
You can’t perform that action at this time.
0 commit comments