flat: 合并
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -225,8 +225,7 @@ const handleFileSend = (rows)=>{
|
||||
type: rows[0].fileSuffix,
|
||||
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=${encodeURI(file.url)}`, { }, 'POST',true,).then((res) => {
|
||||
getUserResume();
|
||||
$api.msg('上传成功');
|
||||
playTextDirectly('上传失败')
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
// 设置搜索类型并触发搜索
|
||||
|
||||
@@ -615,8 +615,7 @@
|
||||
<div class="upload-icon">📁</div>
|
||||
<div class="upload-text" id="uploadText">点击选择文件</div>
|
||||
<div class="upload-hint" id="uploadHint">支持图片、文档、文本等格式</div>
|
||||
<input type="file" id="fileInput" class="file-input" multiple
|
||||
accept="image/*,.pdf,.doc,.docx,.xls,.xlsx,.csv,.ppt,.pptx,.txt,.md" />
|
||||
<input type="file" id="fileInput" class="file-input" multiple />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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 = '支持图片、文档、文本等格式<br />文件大小不超过10MB';
|
||||
uploadHint.innerHTML = `支持格式: ${ACCEPT_TYPES}<br />文件大小不超过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 =
|
||||
`支持图片、文档、文本等格式<br />最多${MAX_FILE_COUNT}个文件,每个不超过10MB<br />已上传: ${uploadedCount}/${MAX_FILE_COUNT}`;
|
||||
uploadHint.innerHTML = `支持格式: ${ACCEPT_TYPES}<br />最多${MAX_FILE_COUNT}个文件,每个不超过10MB`;
|
||||
fileInput.disabled = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user