Commit 07427bcf by haojie

文件名带.导致无法上传的问题

parent 51cbcdb4
......@@ -93,7 +93,6 @@ watch(
}
.custom-card-box {
width: 170px;
height: 224px;
background: #1e1e1e;
border-radius: 8px;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
......@@ -104,13 +103,12 @@ watch(
color: white;
.img-box {
position: relative;
height: 259px;
img {
width: 100%;
height: 174px;
height: 100%;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
// object-fit: contain;
// object-fit: cover;
}
}
.hover {
......
......@@ -87,7 +87,6 @@ const nameChange = (value: string) => {
}
.custom-card-two-box {
width: 200px;
height: 310px;
background: #1e1e1e;
border-radius: 8px;
transition: all 0.2s;
......@@ -98,7 +97,7 @@ const nameChange = (value: string) => {
flex-direction: column;
.custom-card-two-image {
position: relative;
height: 236px;
height: 355px;
.hover {
position: absolute;
top: 0;
......
......@@ -11,7 +11,7 @@ import {
} from 'tdesign-vue-next';
import { getUserCookie } from '@/utils/api/userApi';
import request from '@/utils/otherRequest';
import { isDev, show_message } from '@/utils/tool';
import { getFileSuffix, isDev, show_message } from '@/utils/tool';
import { v4 } from 'uuid';
import Button from '../Button.vue';
......@@ -128,7 +128,7 @@ export default defineComponent({
return false;
}
if (props.accept) {
let fileName = file.name.split('.')[1];
let fileName = getFileSuffix(file);
fileName = fileName.toLowerCase();
let proAccept = props.accept.toLowerCase();
if (proAccept.indexOf(fileName) == -1) {
......
......@@ -40,7 +40,6 @@
}
.more-choices {
width: 170px;
height: 224px;
background: #1e1e1e;
border-radius: 8px;
transition: all 0.2s;
......
......@@ -286,10 +286,9 @@ watch(
.custom-card-box {
background: white;
width: 150px;
height: 200px;
color: black;
img {
height: 150px;
.img-box {
height: 224px;
}
}
.create-digital-person-grid {
......
......@@ -295,9 +295,8 @@ onMounted(() => {
.digital-people-list-box {
margin-top: 12px;
width: 100%;
height: 348px;
background: #303030;
padding: 33px 30px 0px 30px;
padding: 30px;
border-radius: 6px;
display: flex;
flex-direction: column;
......@@ -322,7 +321,6 @@ onMounted(() => {
}
.more-choices {
width: 170px;
height: 224px;
background: #1e1e1e;
border-radius: 8px;
transition: all 0.2s;
......
......@@ -280,8 +280,10 @@ export const alyOssUpload = (
// 获取文件后缀
export const getFileSuffix = (file: any) => {
// 获取最后一个点的位置
if (file.name && file.name.indexOf('.') !== -1) {
return file.name.split('.')[1];
let list = file.name.split('.');
return list[list.length - 1];
} else {
return file.type.split('/')[1];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment