GH页面没有看到我的图像的路径

时间:2016-04-20 02:20:41

标签: css angularjs github-pages

GET http://kbazl3.github.io/style/icons/wind.png 404 (Not Found)
night.png:1 
GET http://kbazl3.github.io/style/icons/night.png 404 (Not Found)
/style/icons/cloudy.png:1 
GET http://kbazl3.github.io/style/icons/cloudy.png 404 (Not Found)
rain.png:1 
GET http://kbazl3.github.io/style/icons/rain.png 404 (Not Found)
alert.png:1 
GET http://kbazl3.github.io/style/icons/alert.png 404 (Not Found)

我在我的gh页面上收到这些错误:http://kbazl3.github.io/RainCheck/#/ 它在我的本地实时服务器上运行得很好

这是指向我的源代码的链接:https://github.com/kbazl3/RainCheck/tree/gh-pages

我已经查找了许多其他SO问题,其他人也有同样的问题,而且总是归结为区分大小写。我的四倍和五倍从我的文件路径检查了我的区分大小写并且它们完全相同。我找不到任何差异。任何帮助将不胜感激。我的文件路径可以在我的weatherService中找到:

//SET CURRENT WEATHER ICONS AND ROUTES
            if (cityObj.icon === "clear-day") {
                cityObj.icon = "clear";
                cityObj.img = "/style/icons/clear.png";
            } else if (cityObj.icon === "partly-cloudy-day") {
                cityObj.icon = "clear";
                cityObj.img = "/style/icons/cloudy.png";
            } else if (cityObj.icon === "rain" || cityObj.icon === "sleet" || cityObj.icon === "hail" || cityObj.icon === "thunderstorm" || cityObj.icon === "tornado") {
                cityObj.icon = "rainy";
                cityObj.img = "/style/icons/rain.png";
            } else if (cityObj.icon === "cloudy") {
                cityObj.icon = "cloudy";
                cityObj.img = "/style/icons/cloudy.png";
            } else if (cityObj.icon === "snow") {
                cityObj.icon = "snowy";
                cityObj.img = "/style/icons/snow.png";
            } else if (cityObj.icon === "clear-night" || cityObj.icon ===   "partly-cloudy-night") {
                cityObj.icon = "clearNight";
                cityObj.img = "/style/icons/night.png";
            } else if (cityObj.icon === "wind") {
                cityObj.icon = "windy";
                cityObj.img = "/style/icons/wind.png";
            } else if (cityObj.icon === "fog") {
                cityObj.icon = "cloudy";
                cityObj.img = "/style/icons/fog.png";
            } 

1 个答案:

答案 0 :(得分:1)

您在路径中看起来需要RainCheck,例如:http://kbazl3.github.io/RainCheck/style/icons/wind.png

由于您的首页为http://kbazl3.github.io/RainCheck,因此相对路径也可以有效:style/icons/wind.png