这是我数据库中存放的图片的路径:
D:\data\temp\\1566005346231.jpg
这是我前端的代码
for (var i = 0; i < data.list.length; i++) {
var product = data.list[i];
console.log(product);
if (product.productStatus == "1") {
product.productStatus = "已上架"
} else {
product.productStatus = "未上架"
}
var tmp = "<tr>\n" +
" <td>" + product.productBarcode + "</td>\n" +
" <td>" + product.productName + "</td>\n" +
" <td>" + product.productPrice + "</td>\n" +
" <td>" + product.productStandard + "</td>\n" +
" <td><img src='"+product.productImage+"'></td>\n" + 这块就是要显示图片的地方
" <td>" + product.productSort + "</td>\n" +
" <td>" + product.productStatus + "</td>\n" +
" <td>" + product.createTime + "</td>\n" +
" <td><input type='button'><a href='http://localhost:8080/productModule/productById?productId=" + product.productId + "'>修改</a></td>\n" +
" <td><input type='button'><a href='http://localhost:8080/productModule/Remove?productId=" + product.productId + "'>删除</a></td>\n" +
" <td><input type='button'><button onclick='productsOnShelves(" + product.productId + ")'>产品上架</bntton></td>\n" +
" <td><input type='button'><button onclick='ProductUndershelf(" + product.productId + ")'>产品下架</button></td>\n" +
" </tr>";
list_html += tmp;
}