getWeathers(params: IGetWeathers)

版本要求:
@ray-js/ray≥1.5.2

描述

获取天气预报信息

参数

参数类型必填说明
是请求参数

返回值

类型:Promise<IGetWeathersResponse>
天气预报信息,包含城市信息及未来多日的天气数据(温度、湿度、风向、风速、日出日落时间等)

示例代码

基础用法

import { getWeathers } from '@ray-js/ray';

getWeathers({
  devId: 'vdevo169477319679442',
  dataRange: 7,
}).then((res) => {
  console.log('天气预报:', res);
}).catch((error) => {
  console.error(error);
});