|
@@ -10,6 +10,7 @@ class AddressComponent extends BaseComponent {
|
|
super();
|
|
super();
|
|
this.tencentkey = 'RLHBZ-WMPRP-Q3JDS-V2IQA-JNRFH-EJBHL';
|
|
this.tencentkey = 'RLHBZ-WMPRP-Q3JDS-V2IQA-JNRFH-EJBHL';
|
|
this.tencentkey2 = 'RRXBZ-WC6KF-ZQSJT-N2QU7-T5QIT-6KF5X';
|
|
this.tencentkey2 = 'RRXBZ-WC6KF-ZQSJT-N2QU7-T5QIT-6KF5X';
|
|
|
|
+ this.tencentkey3 = 'OHTBZ-7IFRG-JG2QF-IHFUK-XTTK6-VXFBN';
|
|
this.baidukey = 'fjke3YUipM9N64GdOIh1DNeK2APO2WcT';
|
|
this.baidukey = 'fjke3YUipM9N64GdOIh1DNeK2APO2WcT';
|
|
this.baidukey2 = 'fjke3YUipM9N64GdOIh1DNeK2APO2WcT';
|
|
this.baidukey2 = 'fjke3YUipM9N64GdOIh1DNeK2APO2WcT';
|
|
}
|
|
}
|
|
@@ -28,7 +29,7 @@ class AddressComponent extends BaseComponent {
|
|
try{
|
|
try{
|
|
let result = await this.fetch('http://apis.map.qq.com/ws/location/v1/ip', {
|
|
let result = await this.fetch('http://apis.map.qq.com/ws/location/v1/ip', {
|
|
ip,
|
|
ip,
|
|
- key: this.tencentkey2,
|
|
|
|
|
|
+ key: this.tencentkey,
|
|
})
|
|
})
|
|
if (result.status != 0) {
|
|
if (result.status != 0) {
|
|
result = await this.fetch('http://apis.map.qq.com/ws/location/v1/ip', {
|
|
result = await this.fetch('http://apis.map.qq.com/ws/location/v1/ip', {
|
|
@@ -36,6 +37,12 @@ class AddressComponent extends BaseComponent {
|
|
key: this.tencentkey2,
|
|
key: this.tencentkey2,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ if (result.status != 0) {
|
|
|
|
+ result = await this.fetch('http://apis.map.qq.com/ws/location/v1/ip', {
|
|
|
|
+ ip,
|
|
|
|
+ key: this.tencentkey3,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
if (result.status == 0) {
|
|
if (result.status == 0) {
|
|
const cityInfo = {
|
|
const cityInfo = {
|
|
lat: result.result.location.lat,
|
|
lat: result.result.location.lat,
|