2023-01-18 07:57:54 -05:00
|
|
|
import axios from "axios"
|
2024-12-27 06:06:20 -05:00
|
|
|
import {requestUtil} from "./requestUtil";
|
2023-01-18 07:57:54 -05:00
|
|
|
export const getCurrentCity=()=>{
|
|
|
|
const localCity = JSON.parse(localStorage.getItem('local_city'))
|
|
|
|
if(!localCity){
|
|
|
|
return new Promise((resolve,reject)=>{
|
|
|
|
const curCity = new window.BMapGL.LocalCity()
|
|
|
|
curCity.get(async res=>{
|
|
|
|
try{
|
|
|
|
const result = await axios.get('http://localhost:8080/area/info?name=${res.name}')
|
|
|
|
localStorage.setItem('local_city',JSON.stringify(result.data.body))
|
|
|
|
resolve(result.data.body)
|
|
|
|
}catch(e){
|
|
|
|
reject(e)
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
// return new Promise((resolve)=>{
|
|
|
|
// return resolve(localCity)
|
|
|
|
// })
|
|
|
|
return Promise.resolve(localCity)
|
2024-12-27 06:06:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export const getTaskList= () => {
|
|
|
|
return requestUtil.get('/todo-server/search/task_message_tree?search=%7B%22pageSize%22%3A20%2C%22pageNumber%22%3A1%2C%22data%22%3A%5B%7B%22name%22%3A%22tree%22%2C%22value%22%3A%22TRUE%22%2C%22operateType%22%3A%22TREE-FILTER%22%7D%2C%7B%22name%22%3A%22state%22%2C%22value%22%3A%228%2C9%22%2C%22operateType%22%3A%22IN%22%7D%5D%7D');
|
|
|
|
|
2023-01-18 07:57:54 -05:00
|
|
|
}
|