diff --git a/packageA/pages/myResume/components/uploadQrcode.vue b/packageA/pages/myResume/components/uploadQrcode.vue index 57abf0b..5d9727a 100644 --- a/packageA/pages/myResume/components/uploadQrcode.vue +++ b/packageA/pages/myResume/components/uploadQrcode.vue @@ -203,7 +203,7 @@ function makeQrcode() { } else { pathPrefix = ''; } - const htmlPath = `${protocol}//${host}${pathPrefix}/static/upload.html?sessionId=${uuid.value}&uploadApi=${config.baseUrl}/app/kiosk/upload&fileCount=${props.leaveFileCount}`; + const htmlPath = `${protocol}//${host}${pathPrefix}/static/upload.html?sessionId=${uuid.value}&uploadApi=${config.baseUrl}/app/kiosk/upload&fileCount=${props.leaveFileCount}&accept='.pdf,.png,.jpg'`; // const htmlPath = `${window.location.host}/static/upload.html?sessionId=${uuid.value}&uploadApi=${ // config.baseUrl + '/app/kiosk/upload' diff --git a/packageA/pages/myResume/myResume.vue b/packageA/pages/myResume/myResume.vue index 5818063..2b2a9d1 100644 --- a/packageA/pages/myResume/myResume.vue +++ b/packageA/pages/myResume/myResume.vue @@ -226,7 +226,7 @@ const handleFileSend = (rows)=>{ name: rows[0].originalName, } - $api.createRequest('/app/oss/uploadToObs', { userId: userInfo.value.userId,url:file.url }, 'POST').then((res) => { + $api.createRequest('/app/oss/uploadToObs', { userId:userInfo.value.userId, filePath:file.url }, 'POST').then((res) => { getUserResume(); $api.msg('上传成功'); playTextDirectly('上传失败') diff --git a/pages/search/search.vue b/pages/search/search.vue index d28370f..65d2423 100644 --- a/pages/search/search.vue +++ b/pages/search/search.vue @@ -226,7 +226,7 @@ function getMajorDataSource() { console.log(majorDataSource.value) } }; - $api.createRequestWithCache('/app/common/jobTitle/treeselect', {}, 'GET', false, LoadCache).then(LoadCache); + $api.createRequestWithCache('/app/common/majorManagement/getMajorList', {}, 'GET', false, LoadCache).then(LoadCache); } // 设置搜索类型并触发搜索 diff --git a/static/upload.html b/static/upload.html index 97826c0..0ac8c40 100644 --- a/static/upload.html +++ b/static/upload.html @@ -615,8 +615,7 @@
📁
点击选择文件
支持图片、文档、文本等格式
- + @@ -663,6 +662,9 @@ const sessionId = urlParams.get('sessionId'); const uploadApi = urlParams.get('uploadApi'); const fileCountParam = urlParams.get('fileCount'); + const acceptParam = urlParams.get('accept'); + const DEFAULT_ACCEPT = 'image/*,.pdf,.doc,.docx,.xls,.xlsx,.csv,.ppt,.pptx,.txt,.md'; + const ACCEPT_TYPES = acceptParam ? acceptParam : DEFAULT_ACCEPT; // 配置常量 const MAX_FILE_COUNT = fileCountParam ? parseInt(fileCountParam) : 2; // 从URL参数获取,默认为2 @@ -671,6 +673,7 @@ console.log('Session ID:', sessionId); console.log('Upload API:', uploadApi); console.log('Max file count:', MAX_FILE_COUNT); + console.log('允许上传类型:', ACCEPT_TYPES); // DOM元素 const uploadArea = document.getElementById('uploadArea'); @@ -692,6 +695,10 @@ const limitWarningInfo = document.getElementById('limitWarningInfo'); const limitWarningText = document.getElementById('limitWarningText'); + + //设置文件类型 + fileInput.accept = ACCEPT_TYPES; + // 状态变量 let selectedFiles = []; let isUploading = false; @@ -1079,7 +1086,7 @@ if (MAX_FILE_COUNT <= 0) { // 如果没有设置文件数量限制,始终可以上传 uploadText.textContent = '点击选择文件'; - uploadHint.innerHTML = '支持图片、文档、文本等格式
文件大小不超过10MB'; + uploadHint.innerHTML = `支持格式: ${ACCEPT_TYPES}
文件大小不超过10MB`; fileInput.disabled = false; } else if (selectedFiles.length >= MAX_FILE_COUNT) { uploadText.textContent = `已达到最大文件数量(${MAX_FILE_COUNT}个)`; @@ -1087,8 +1094,7 @@ fileInput.disabled = true; } else { uploadText.textContent = '点击选择文件'; - uploadHint.innerHTML = - `支持图片、文档、文本等格式
最多${MAX_FILE_COUNT}个文件,每个不超过10MB
已上传: ${uploadedCount}/${MAX_FILE_COUNT}`; + uploadHint.innerHTML = `支持格式: ${ACCEPT_TYPES}
最多${MAX_FILE_COUNT}个文件,每个不超过10MB`; fileInput.disabled = false; }