mirror of
https://github.com/zuiidea/antd-admin
synced 2026-11-04 17:37:20 +00:00
666
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {myCity} from '../services/dashboard'
|
||||
import {myCity,queryWeather} from '../services/dashboard'
|
||||
import {parse} from 'qs'
|
||||
|
||||
export default {
|
||||
@@ -17,8 +17,12 @@ export default {
|
||||
*queryWeather({
|
||||
payload
|
||||
}, {call, put}) {
|
||||
const result = yield call(myCity, parse(payload))
|
||||
const myCityResult = yield call(myCity, {flg:0})
|
||||
const myCityData = myCityResult.query.results.json
|
||||
|
||||
const result = yield call(queryWeather, {cityCode:myCityData.selectCityCode})
|
||||
const data = result.query.results.json
|
||||
|
||||
console.log(data)
|
||||
// if (data.success) {
|
||||
// yield put({
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
import { request } from '../utils'
|
||||
import qs from 'qs'
|
||||
|
||||
export async function myCity() {
|
||||
export async function myCity(params) {
|
||||
return request('http://www.zuimeitianqi.com/zuimei/myCity', {
|
||||
method: 'get',
|
||||
cross:true,
|
||||
data:{flg:0},
|
||||
data:params,
|
||||
})
|
||||
}
|
||||
|
||||
export async function queryWeather(params) {
|
||||
return request('http://www.zuimeitianqi.com/zuimei/queryWeather', {
|
||||
method: 'get',
|
||||
cross:true,
|
||||
data:params,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user