From f0ca3f172c123aac58c62fb96b9d22e96ccba923 Mon Sep 17 00:00:00 2001 From: zuiidea Date: Mon, 12 Dec 2016 22:53:01 +0800 Subject: [PATCH] Weather --- src/components/dashboard/weather.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/dashboard/weather.js b/src/components/dashboard/weather.js index d2daabe..ba18f2e 100644 --- a/src/components/dashboard/weather.js +++ b/src/components/dashboard/weather.js @@ -2,19 +2,18 @@ import React, {PropTypes} from 'react' import {Icon} from 'antd' import styles from './weather.less' import {classnames, request} from '../../utils' - +const Ajax = require("robe-ajax") const Weather = React.createClass({ componentDidMount() { this.fetch() }, fetch() { - request('http://api.map.baidu.com/telematics/v3/weather?location=成都&output=json&ak=33MHEPwOLqG8YwynptbWCCFSqry9IEYb',{ - method:'get', - dataType:'JSON', - success: function (res) { - console.log(res) - } + Ajax.getJSON("http://query.yahooapis.com/v1/public/yql", { + q: "select * from json where url=\"http://www.zuimeitianqi.com/zuimei/myCity?flg=0\"", + format: "json" + }, function (data) { + console.log(data) }) }, render() {