提交者
Gitee
update ruoyi-ui/src/components/ImageUpload/index.vue.
【fix】修复后台前端上传图片如果图片路径已经携带域名就无需增加前缀域名 Signed-off-by: AZP <2198774759@qq.com>
正在显示
1 个修改的文件
包含
2 行增加
和
1 行删除
| @@ -44,6 +44,7 @@ | @@ -44,6 +44,7 @@ | ||
| 44 | 44 | ||
| 45 | <script> | 45 | <script> |
| 46 | import { getToken } from "@/utils/auth"; | 46 | import { getToken } from "@/utils/auth"; |
| 47 | +import { isExternal } from "@/utils/validate"; | ||
| 47 | 48 | ||
| 48 | export default { | 49 | export default { |
| 49 | props: { | 50 | props: { |
| @@ -93,7 +94,7 @@ export default { | @@ -93,7 +94,7 @@ export default { | ||
| 93 | // 然后将数组转为对象数组 | 94 | // 然后将数组转为对象数组 |
| 94 | this.fileList = list.map(item => { | 95 | this.fileList = list.map(item => { |
| 95 | if (typeof item === "string") { | 96 | if (typeof item === "string") { |
| 96 | - if (item.indexOf(this.baseUrl) === -1) { | 97 | + if (item.indexOf(this.baseUrl) === -1 && !isExternal(item)) { |
| 97 | item = { name: this.baseUrl + item, url: this.baseUrl + item }; | 98 | item = { name: this.baseUrl + item, url: this.baseUrl + item }; |
| 98 | } else { | 99 | } else { |
| 99 | item = { name: item, url: item }; | 100 | item = { name: item, url: item }; |
-
请 注册 或 登录 后发表评论