Skip to content

Commit d7f714b

Browse files
committed
perf: 优化上传图片带域名时不增加前缀
1 parent 0a02d73 commit d7f714b

File tree

1 file changed

+2
-1
lines changed
  • ruoyi-fastapi-frontend/src/components/ImageUpload

1 file changed

+2
-1
lines changed

ruoyi-fastapi-frontend/src/components/ImageUpload/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
<script>
4646
import { getToken } from "@/utils/auth";
47+
import { isExternal } from "@/utils/validate";
4748
4849
export default {
4950
props: {
@@ -93,7 +94,7 @@ export default {
9394
// 然后将数组转为对象数组
9495
this.fileList = list.map(item => {
9596
if (typeof item === "string") {
96-
if (item.indexOf(this.baseUrl) === -1) {
97+
if (item.indexOf(this.baseUrl) === -1 && !isExternal(item)) {
9798
item = { name: this.baseUrl + item, url: this.baseUrl + item };
9899
} else {
99100
item = { name: item, url: item };

0 commit comments

Comments
 (0)