优达学城 天气小程序 上线域名不合法
发布于 6 年前 作者 jie48 1988 次浏览 来自 问答

优达学城用的天气api如何加入合法域名中?

api有两个:https://test-miniprogram.com/api/weather/now’https://test-miniprogram.com/api/weather/future

因为现在这两个不是合法域名,所以在手机中看的数据都是空白,电脑模拟器由于打开了“不校验域名所以是正常可看的”

对应代码如下:

wx.request({

url: https://test-miniprogram.com/api/weather/now,

data: {

time: new Date().getTime(),

city: this.data.city

},

wx.request({

url: https://test-miniprogram.com/api/weather/future,

data: {

time: new Date().getTime(),

city: this.data.city

2 回复

test-miniprogram.com 就可以了,后面的那些不需要

只需要填写域名哦

回到顶部