✨ feat: 部分修改
This commit is contained in:
@@ -57,7 +57,7 @@ const props = defineProps({
|
||||
// 上传接口地址
|
||||
action: {
|
||||
type: String,
|
||||
default: "/common/upload"
|
||||
default: "/system/oss/upload"
|
||||
},
|
||||
// 上传携带的参数
|
||||
data: {
|
||||
@@ -117,7 +117,7 @@ watch(() => props.modelValue, val => {
|
||||
fileList.value = list.map(item => {
|
||||
if (typeof item === "string") {
|
||||
if (item.indexOf(baseUrl) === -1 && !isExternal(item)) {
|
||||
item = { name: baseUrl + item, url: baseUrl + item }
|
||||
item = { name: item, url: item }
|
||||
} else {
|
||||
item = { name: item, url: item }
|
||||
}
|
||||
@@ -173,7 +173,8 @@ function handleExceed() {
|
||||
// 上传成功回调
|
||||
function handleUploadSuccess(res, file) {
|
||||
if (res.code === 200) {
|
||||
uploadList.value.push({ name: res.fileName, url: res.fileName })
|
||||
console.log(res, '上传成功')
|
||||
uploadList.value.push({ name: res.data.fileName, url: res.data.url })
|
||||
uploadedSuccessfully()
|
||||
} else {
|
||||
number.value--
|
||||
@@ -223,7 +224,7 @@ function listToString(list, separator) {
|
||||
separator = separator || ","
|
||||
for (let i in list) {
|
||||
if (undefined !== list[i].url && list[i].url.indexOf("blob:") !== 0) {
|
||||
strs += list[i].url.replace(baseUrl, "") + separator
|
||||
strs += list[i].url + separator
|
||||
}
|
||||
}
|
||||
return strs != "" ? strs.substr(0, strs.length - 1) : ""
|
||||
|
||||
Reference in New Issue
Block a user