我该如何修复图像 src
how can i fix image src
当我使用这段代码时,它是正确的:
img(src="http://localhost:3030/uploads/customerimages/42.jpg", alt="image")
但是这段代码给出了 404 错误:
img(src="./uploads/customerimages/42.jpg", alt="image")
.
第二个输出是http://localhost:3050/information/edit/uploads/customerimages/42.jpg
但需要 http://localhost:3030/uploads/customerimages/42.jpg.
http://localhost:3050/information/edit 是当前路线。
我该如何解决这个问题?
只需删除 url
之前的点
使用喜欢
img(src="/uploads/customerimages/42.jpg", alt="image")
当我使用这段代码时,它是正确的:
img(src="http://localhost:3030/uploads/customerimages/42.jpg", alt="image")
但是这段代码给出了 404 错误:
img(src="./uploads/customerimages/42.jpg", alt="image")
.
第二个输出是http://localhost:3050/information/edit/uploads/customerimages/42.jpg
但需要 http://localhost:3030/uploads/customerimages/42.jpg.
http://localhost:3050/information/edit 是当前路线。
我该如何解决这个问题?
只需删除 url
之前的点
使用喜欢
img(src="/uploads/customerimages/42.jpg", alt="image")