# 查询地址
const request = {
"Location":"31.22024,121.42394",
"pois":1,
"CoordType":"gcj02ll",
"head":{
"cid":"09301151210179487344",
"ctok":"",
"cver":"1.1.91",
"lang":"01",
"sid":"",
"syscode":"30",
"auth":"EB5D1B72EE5B47F5B4DCDC051FE157363A52CB266B687BDD8FCF24064F62BA2F",
"sauth":"",
"extension":[
{
"name":"appId",
"value":"wx0e6ed4f51db9d078"
},
{
"name":"scene",
"value":"1001"
}
]
}
}
// 返回 本人当前坐标地址和周边信息
const response = {
"ResponseStatus":{
"Timestamp":"/Date(1621337271106+0800)/",
"Ack":"Success",
"Errors":[
],
"Extension":[
{
"Id":"CLOGGING_TRACE_ID",
"Value":"2787110057369327658"
},
{
"Id":"RootMessageId",
"Value":"100025527-0a0ed3cc-450371-3089646"
}
]
},
"location":{
"lat":31.226487103671747,
"lng":121.43039444275101
},
"formattedAddress":"上海市长宁区长宁路599号-10楼",
"business":"龙之梦购物中心,中山公园,武宁地区",
"addressComponent":{
"country":"中国",
"countryCode":0,
"province":"上海市",
"city":"上海市",
"district":"长宁区",
"adcode":"310105",
"street":"长宁路",
"streetNumber":"599号-10楼",
"direction":"附近",
"distance":"1"
},
"pois":[
{
"addr":"上海市长宁区愚园路1320号",
"cp":"",
"direction":"内",
"distance":"0",
"name":"长宁金融园",
"poiType":"公司企业",
"point":{
"x":121.4304594957924,
"y":31.225314787113074
},
"tag":"公司企业;园区",
"tel":"",
"uid":"57238ed691866ec24354d744",
"zip":""
},
{
"addr":"上海市长宁区长宁路599号",
"cp":" ",
"direction":"西南",
"distance":"58",
"name":"长宁区政府",
"poiType":"政府机构",
"point":{
"x":121.430872716327,
"y":31.226665778834327
},
"tag":"政府机构;各级政府",
"tel":"",
"uid":"03d8ebf664fa156417b54bf8",
"zip":""
},
{
"addr":"上海市长宁区长宁路599号6楼",
"cp":" ",
"direction":"附近",
"distance":"1",
"name":"长宁区房管局",
"poiType":"政府机构",
"point":{
"x":121.4303876313516,
"y":31.226480501123667
},
"tag":"政府机构;行政单位",
"tel":"",
"uid":"00487aaf57eb3ceb8b2fb51b",
"zip":""
},
{
"addr":"长宁区上海市长宁路599号12楼",
"cp":" ",
"direction":"附近",
"distance":"1",
"name":"长宁区卫生局",
"poiType":"政府机构",
"point":{
"x":121.4303876313516,
"y":31.226480501123667
},
"tag":"政府机构;行政单位",
"tel":"",
"uid":"75d0881ac666014c3a04b163",
"zip":""
},
{
"addr":"长宁路599号",
"cp":" ",
"direction":"附近",
"distance":"1",
"name":"长宁区档案局",
"poiType":"政府机构",
"point":{
"x":121.4303876313516,
"y":31.226480501123667
},
"tag":"政府机构;行政单位",
"tel":"",
"uid":"0a15c7ec16aaabfded74f863",
"zip":""
},
{
"addr":"长宁路599号",
"cp":" ",
"direction":"附近",
"distance":"1",
"name":"长宁区审计局",
"poiType":"政府机构",
"point":{
"x":121.4303876313516,
"y":31.226480501123667
},
"tag":"政府机构;行政单位",
"tel":"",
"uid":"3564f5d690e3753979b55c26",
"zip":""
},
{
"addr":"长宁路599号",
"cp":" ",
"direction":"附近",
"distance":"1",
"name":"长宁区文化和旅游局",
"poiType":"政府机构",
"point":{
"x":121.4303876313516,
"y":31.226480501123667
},
"tag":"政府机构;行政单位",
"tel":"",
"uid":"101bc61b0d84daa2c42ba163",
"zip":""
},
{
"addr":"愚园路1292弄51、53号",
"cp":" ",
"direction":"西北",
"distance":"97",
"name":"沈钧儒旧居",
"poiType":"旅游景点",
"point":{
"x":121.4310613604841,
"y":31.225994145387897
},
"tag":"旅游景点;文物古迹",
"tel":"",
"uid":"c66211556f36cacb3c9a5ea4",
"zip":""
},
{
"addr":"上海市愚园路1333号",
"cp":" ",
"direction":"北",
"distance":"188",
"name":"汉庭酒店(中山公园二店)",
"poiType":"酒店",
"point":{
"x":121.43040559746181,
"y":31.225029146365742
},
"tag":"酒店;快捷酒店",
"tel":"",
"uid":"d0b8923fe20d36fbb4f42fef",
"zip":""
},
{
"addr":"上海市长宁区愚园路一二八〇弄18号",
"cp":" ",
"direction":"西北",
"distance":"141",
"name":"上海市长宁区愚园路第一幼儿园(愚园路总园)",
"poiType":"教育培训",
"point":{
"x":121.431232038531,
"y":31.225669906826475
},
"tag":"教育培训;幼儿园",
"tel":"",
"uid":"f189282b76eccc66ae080fd6",
"zip":""
}
],
"cityCode":289,
"sematicDescription":"长宁金融园内,长宁区房管局附近1米"
}
// 根据当前信息查询坐标城市
// https://m.ctrip.com/restapi/soa2/14605/timezone
const timeZoneRequest = {
"coordType":2,
"lat":31.22024,
"lng":121.42394,
"head":{
"cid":"09301151210179487344",
"ctok":"",
"cver":"1.1.91",
"lang":"01",
"sid":"",
"syscode":"30",
"auth":"EB5D1B72EE5B47F5B4DCDC051FE157363A52CB266B687BDD8FCF24064F62BA2F",
"sauth":"",
"extension":[
{
"name":"sdkversion",
"value":"2.16.1"
},
{
"name":"openid",
"value":"e982f9b7-f48d-45b7-8fdb-4fd3ee1a3f4e"
},
{
"name":"pageid",
"value":"10650004235"
},
{
"name":"supportWebP",
"value":"false"
},
{
"name":"ubt",
"value":'{"vid":"1621336703754.yqp938","sid":1,"pvid":1,"ts":1621336703754,"create":1621336703754,"pid":0}'
},
{
"name":"appId",
"value":"wx0e6ed4f51db9d078"
},
{
"name":"scene",
"value":"1001"
}
]
}
}
// 返回当前坐标的具体城市和城市ID
const timeZoneResponse = {
"ResponseStatus":{
"Timestamp":"/Date(1621337271151+0800)/",
"Ack":"Success",
"Errors":[
],
"Extension":[
{
"Id":"request-id",
"Value":"09456eda-d2ea-49e6-b35b-0212883f8b1d"
},
{
"Id":"CLOGGING_TRACE_ID",
"Value":"3913766509225915488"
},
{
"Id":"RootMessageId",
"Value":"100025527-0a0effc8-450371-3090691"
}
]
},
"code":200,
"data":{
"timeZone":0,
"cityId":2,
"cityName":"上海",
"cityEName":"Shanghai",
"countryId":1,
"dstOffset":0
}
}