日常Bug总结

165 阅读1分钟

报错信息:[渲染层网络层错误] Failed to load local image resource /pages/cate/item3.cat_icon the server responded with a status of 500 (HTTP/1.1 500 Internal Server Error) (env: macOS,mp,1.06.2206090; lib: 2.24.6)

絕大多數此类問題在根目錄的config.php文件中設定錯誤,通常是資料庫的名稱、使用者名稱、密碼...等,或者是路徑多了空格、多了.之類的問題

原因以及解决办法: 忘记在image的src前加上冒号


报错信息: 请求图片时显示502 Bad Gateway

解决办法: <img :src="item3.cat_icon> => <img :src="item3.cat_icon.replace('dev','web)"

原因:接口路径问题


Problem: 后缀名为.webp的图片无法在ios中显示

solution: 用replace api 将.webp 换成 .jpeg


Problem: Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined

Solution: 在main.js中 import {$http} from '@escook/request-miniprogram'之后误删除`uni.http=http = http


Problem: 改变uniapp默认输出目录

Solution: 通过在package.json中的命令中添加UNI_OUT_DIR='需要输出的目录'