zhengyiming
12 小时以前 19fd07d35d59b54ad9154eab18d253fac1fa49f0
packages/utils/location.ts
@@ -26,7 +26,7 @@
  static currentProvinceName: string;
  static blackList = ['江西省'];
  static blackList = [];
  static async getLocation() {
    if (!this.wxLocation) {
@@ -45,7 +45,7 @@
  }
  static async getLocationImp() {
    let geocoderRes = await this.getLocationByIp().catch(() => this.getLocationByIp());
    let geocoderRes = await this.getLocationByGeocoder().catch(() => this.getLocationByIp());
    console.log('geocoderRes: ', geocoderRes);
    return geocoderRes;
@@ -87,7 +87,10 @@
  static getLocationByIp() {
    return axios
      .get<LocationResponse>(
        `https://apis.map.qq.com/ws/location/v1/ip?key=HH7BZ-5L2KI-TN3GW-U5HKU-MK5H3-VOBZH`
        `https://apis.map.qq.com/ws/location/v1/ip?key=HH7BZ-5L2KI-TN3GW-U5HKU-MK5H3-VOBZH`,
        {
          timeout: 3000,
        }
      )
      .then((res) => res.data);
  }