|
@@ -62,6 +62,10 @@ const props = defineProps({
|
|
|
isShowTip: {
|
|
|
type: Boolean,
|
|
|
default: true
|
|
|
+ },
|
|
|
+ urltype:{
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -69,7 +73,7 @@ const { proxy } = getCurrentInstance();
|
|
|
const emit = defineEmits();
|
|
|
const number = ref(0);
|
|
|
const uploadList = ref([]);
|
|
|
-const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload"); // 上传文件服务器地址
|
|
|
+const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload" + props.urltype); // 上传文件服务器地址
|
|
|
const headers = ref({ Authorization: "Bearer " + getToken() });
|
|
|
const fileList = ref([]);
|
|
|
const showTip = computed(
|
|
@@ -138,6 +142,9 @@ function handleUploadError(err) {
|
|
|
// 上传成功回调
|
|
|
function handleUploadSuccess(res, file) {
|
|
|
if (res.code === 200) {
|
|
|
+ if (props.urltype == '/v1')
|
|
|
+ uploadList.value.push({ name: res.data.url, url: res.data.path });
|
|
|
+ else
|
|
|
uploadList.value.push({ name: res.data.url, url: res.data.url });
|
|
|
uploadedSuccessfully();
|
|
|
} else {
|