ZhangXianQiang
2024-07-02 34c98099b187bef54aa81fc3fa680fe8099eb3ad
feat:资源文件列表接口
1个文件已修改
1个文件已添加
16 ■■■■ 已修改文件
src/api/modules/file.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/folder/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/modules/file.js
New file
@@ -0,0 +1,5 @@
import service from "@/api";
export const getFileList = () => {
  return service.get('/api/student/education/resource/page');
};
src/views/folder/index.vue
@@ -56,7 +56,7 @@
import { ref } from 'vue';
import NormalHeader from '@/components/NormalHeader/index.vue';
import { Search } from '@element-plus/icons-vue';
import { getFileList } from '@/api/modules/file.js';
const fileType = {
  'img': {
@@ -69,14 +69,12 @@
    iconPath: '/static/icons/file_type_video.png',
    handle: (item) => {
      console.log(item);
    }
  },
  'pdf': {
    iconPath: '/static/icons/file_type_image.png',
    handle: (item) => {
      console.log(item);
    }
  },
};
@@ -120,6 +118,13 @@
  fileType[item.type] && fileType[item.type].handle(item);
};
const getData = () => {
  getFileList().then(res => {
  });
};
getData();
</script>
<style lang="scss" scoped>