feat: 配置了插件动态导入,新增了一个完成度不高的代码编辑插件

This commit is contained in:
539943419 committed 2024-08-29 12:24:40 +08:00
1 parent 803fd69850
commit 86b3a02237
9 files changed
+414 -35

No files matched your search

+21 -1
View File
@@ -67,9 +67,29 @@ const miaoFetchApi = {
return response.data
},
/**
* 获取对应文件夹下的数据
*/
async getFile(
vFile: VirtualFile,
option?: getOption
): Promise<getResponse> {
// const { baseUrl, api } = Config
const url = vFile.url
const retry = option?.retry ?? 0
const { miaoFetch } = useMiaoFetch({
retry
})
const response = await miaoFetch({
url
})
return response.data
},
/**
* 上传单个文件到对应文件夹, 后续要将data类型改成buffer以支持分片上传
* 正常上传文件请使用uploadQueue
* 正常上传文件请使用uploadQueue
*/
upload(data: File, targetVDir: VirtualDirectory, option?: uploadOption) {
const { baseUrl, api } = Config