diff --git a/src/api/all/common.ts b/src/api/all/common.ts index fc1e92a..7deae61 100644 --- a/src/api/all/common.ts +++ b/src/api/all/common.ts @@ -73,7 +73,12 @@ export const getVideoPreSignedUrl = (params = {}) => { return Http.get('/v1/oss/video-pre-signed-url', params); }; +// 获取文件上传地址 +export const getFilePreSignedUrl = (params = {}) => { + return Http.get('/v1/oss/file-pre-signed-url', params); +}; + // 清除限流 export const postClearRateLimiter = (params = {}) => { return Http.post(`/v1/rate-limiter/clear`, params); -}; \ No newline at end of file +}; diff --git a/src/styles/components/ant-button.scss b/src/styles/components/ant-button.scss index 29bc47e..80b188b 100644 --- a/src/styles/components/ant-button.scss +++ b/src/styles/components/ant-button.scss @@ -71,7 +71,7 @@ } &:active { - background: $color-primary-7 !important; + background-color: $color-primary-7 !important; } } diff --git a/src/utils/tools.ts b/src/utils/tools.ts index 5df5a36..c0f2580 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -112,11 +112,15 @@ export function genRandomId() { return `id_${dayjs().unix()}_${Math.floor(Math.random() * 10000)}`; } +export function getFileExtension(filename) { + const match = filename.match(/\.([^.]+)$/); + return match ? match[1].toLowerCase() : ''; +} export function formatFileSize(bytes: number): string { if (bytes === 0) return '0 Bytes'; const k = 1024; - const sizes = ['Bytes', 'kb', 'mB', 'gB', 'tB']; + const sizes = ['Bytes', 'kb', 'mb', 'gb', 'tb']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; @@ -218,7 +222,7 @@ export function getVideoInfo(file: File): Promise<{ duration: number; firstFrame }; // 设置视频源以触发加载 - video.src = URL.createObjectURL(file); + video.src = window.URL.createObjectURL(file); // 设置超时,防止长时间无响应 setTimeout(() => { diff --git a/src/views/material-center/components/raw-material/components/add-raw-material-drawer/index.vue b/src/views/material-center/components/raw-material/components/add-raw-material-drawer/index.vue index 57659a3..e8fbb40 100644 --- a/src/views/material-center/components/raw-material/components/add-raw-material-drawer/index.vue +++ b/src/views/material-center/components/raw-material/components/add-raw-material-drawer/index.vue @@ -1,5 +1,5 @@ diff --git a/src/views/material-center/components/raw-material/img/icon-no-text.png b/src/views/material-center/components/raw-material/img/icon-no-text.png new file mode 100644 index 0000000..2cbb9e0 Binary files /dev/null and b/src/views/material-center/components/raw-material/img/icon-no-text.png differ