feat: api请求按路由分割
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { getDepartmentList, getDepartmentDetail } from '@/api/setting';
|
||||
import { getDepartmentList, getDepartmentDetail } from '@/api/department';
|
||||
import { DepartmentItem } from '@/types/setting';
|
||||
|
||||
export default function useDepartmentList(autoFetch = true) {
|
||||
@@ -40,8 +40,8 @@ export default function useDepartmentList(autoFetch = true) {
|
||||
);
|
||||
departmentListData.value = fetchDepartmentList;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取部门列表失败:', error);
|
||||
} catch {
|
||||
// 获取部门列表失败,静默处理
|
||||
}
|
||||
};
|
||||
|
||||
@@ -52,8 +52,7 @@ export default function useDepartmentList(autoFetch = true) {
|
||||
return data;
|
||||
}
|
||||
return null;
|
||||
} catch (error) {
|
||||
console.error('获取部门详情失败:', error);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user