I could be mistaken, but are you using backticks in the api
assignment?
(我可能会弄错,但是您在api
分配中使用了反引号吗?)
const api = '${proxy}https://api.darksky.net/forecast/09e239664b0eb3d9ee3f2e5e9463217a/${lat},${long}';
If you use single quotes, the ${proxy}
etc. won't be interpolated.
(如果使用单引号,则不会插入${proxy}
等。)
Check your network tab in the Developer Tools to be sure.
(确保在开发人员工具中检查您的网络标签。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…