try { const url = `https://api.map.baidu.com/location/ip?ip=${ip}&ak=${this.app.config.BAIDUAK}&coor=bd09ll`; const result = await this.app.curl(url, { dataType: 'json', });
async getWeather(location) { const { app } = this; const res = await app.curl('https://api.map.baidu.com/telematics/v3/weather', { data: { ak: 'zVo5SStav7IUiVON0kuCogecm87lonOj', output: 'json', location, }, dataType: 'json', }); // console.log(res.data.results[0]); if (res.data.error === 0) { return res.data.results[0]; } return { code: -1, msg: '请输入正确的城市名称', }; }
const response = await this.app.curl(url, { method: body.method, contentType: 'application/json',
}; const url = this.app.config.outApi.appList; const response = await this.app.curl(url, { method: 'GET', contentType: 'application/json',
try { const url = `https://api.map.baidu.com/location/ip?ip=${ip}&ak=${this.app.config.BAIDUAK}&coor=bd09ll`; const result = await this.app.curl(url, { dataType: 'json', });