获取 http://localhost//images/Products/ 403(禁止)

GET http://localhost//images/Products/ 403 (Forbidden)

本文关键字:禁止 Products images http localhost 获取      更新时间:2023-09-26

我有一个简单的angularjs html页面,它正在从api调用中检索一些图像。

<div class="col-xs-12" >
    <h3>Product List</h3>
</div>
<div class="col-xs-12" ng-controller="productCtrl as ctrl" >
    <div class="well" ng-repeat="item in ctrl.products">
        <h3>
            <img style="float:left; height:80px; margin-right:10px" 
                ng-src="images/Products/{{item.Imagename  || '' }}" >
            <strong>{{item.Name}}</strong>
            <span class="pull-right label label-primary">
                {{item.Price | currency}}
            </span>
        </h3>
        <button ng-click="addProductToCart(item)" class="btn btn-success pull-right">
            Add to cart
        </button>
        <span class="small">{{item.Description}}</span>
    </div>
</div>

一切正常,数据显示,但是图像没有显示403禁止错误。

我尝试向IIS_IUSRS和用户(本地PC(添加权限,但是我仍然遇到相同的错误。

尝试在Google和StackOverflow上搜索,但是没有解决方案可以解决我的问题。

我该如何解决这个问题?

感谢您的帮助和时间。

也许这应该<img [..] ng-src="{{item.Imagename && 'images/Products/' + item.Imagename || '' }}" >

通过此修改,内容为空,直到数据到达。