mirror of
https://github.com/yangzongzhuan/RuoYi-Vue3.git
synced 2025-06-07 10:49:30 +00:00
优化上传图片带域名不增加前缀
This commit is contained in:
parent
d02ba57ffb
commit
7507a187aa
@ -47,6 +47,7 @@
|
||||
|
||||
<script setup>
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { isExternal } from "@/utils/validate";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: [String, Object, Array],
|
||||
@ -93,7 +94,7 @@ watch(() => props.modelValue, val => {
|
||||
// 然后将数组转为对象数组
|
||||
fileList.value = list.map(item => {
|
||||
if (typeof item === "string") {
|
||||
if (item.indexOf(baseUrl) === -1) {
|
||||
if (item.indexOf(baseUrl) === -1 && !isExternal(item)) {
|
||||
item = { name: baseUrl + item, url: baseUrl + item };
|
||||
} else {
|
||||
item = { name: item, url: item };
|
||||
|
Loading…
Reference in New Issue
Block a user