Skip to content

Commit

Permalink
add tencentkey
Browse files Browse the repository at this point in the history
  • Loading branch information
bailicangdu committed Dec 21, 2017
1 parent b052cbe commit 335fb86
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion prototype/addressComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AddressComponent extends BaseComponent {
super();
this.tencentkey = 'RLHBZ-WMPRP-Q3JDS-V2IQA-JNRFH-EJBHL';
this.tencentkey2 = 'RRXBZ-WC6KF-ZQSJT-N2QU7-T5QIT-6KF5X';
this.tencentkey3 = 'OHTBZ-7IFRG-JG2QF-IHFUK-XTTK6-VXFBN';
this.baidukey = 'fjke3YUipM9N64GdOIh1DNeK2APO2WcT';
this.baidukey2 = 'fjke3YUipM9N64GdOIh1DNeK2APO2WcT';
}
Expand All @@ -28,14 +29,20 @@ class AddressComponent extends BaseComponent {
try{
let result = await this.fetch('http://apis.map.qq.com/ws/location/v1/ip', {
ip,
key: this.tencentkey2,
key: this.tencentkey,
})
if (result.status != 0) {
result = await this.fetch('http://apis.map.qq.com/ws/location/v1/ip', {
ip,
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) {
const cityInfo = {
lat: result.result.location.lat,
Expand Down

0 comments on commit 335fb86

Please sign in to comment.