import { _pushSuccess } from "../app" ; import { parseTotal , parseWorldMap , totalTask , worldMapTask } from "../utils/task" ; import { axios } from "../utils/axios" ; desc param socket param data param channel param eventName export const getWorldMap = async ( socket , data , channel , eventName ) => { axios . get ( 'https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5&callback=' ) . then ( async ( res ) => { if ( res . ret === 0 ) { const allData = JSON . parse ( res . data || { } ) ; const worldMapData = parseWorldMap ( allData . areaTree ) ; await _pushSuccess ( channel , eventName , worldMapData ) ; res = null ; } } ) . catch ( ( err ) => { console . info ( 'getWorldMap' , err ) ; } ) ; } ; desc export const getTotal = async ( socket , data , channel , eventName ) => { axios . get ( 'https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5&callback=' ) . then ( async ( res ) => { if ( res . ret === 0 ) { const allData = JSON . parse ( res . data || { } ) ; const totalData = parseTotal ( allData . chinaTotal , allData . areaTree . slice ( 1 ) , allData . lastUpdateTime ) ; await _pushSuccess ( channel , eventName , totalData ) ; res = null ; } } ) . catch ( ( err ) => { console . info ( "getTotal" , err ) ; } ) ; } ;