Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix(location): 修复直辖市不能正常显示定位的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Nov 1, 2018
1 parent 3c5f696 commit c606e8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/bootstrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export async function getHotCities() {
*/
export async function getCurrentPosition() {
let data = await location.getCurrentPosition();
let { city } = data.addressComponent || {};
let { city, province, formatted_address } = data.addressComponent || {};

return {
lng: data.position.getLng(),
lat: data.position.getLat(),
label: city || "定位失败"
label: city || province || formatted_address || "定位失败"
};
}

Expand Down

0 comments on commit c606e8e

Please sign in to comment.