|
|
@@ -93,6 +93,7 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
|
|
|
latestLocation({
|
|
|
date_start: strYesterday, date_end: strTomorrow
|
|
|
}).then(data => {
|
|
|
+ console.log(data)
|
|
|
setAuthInfo(data as any)
|
|
|
updateDate(data)
|
|
|
locationDetail = data
|
|
|
@@ -478,15 +479,21 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
|
|
|
}
|
|
|
|
|
|
function getLocation() {
|
|
|
+ console.log((authInfo as any).address)
|
|
|
var city = ''
|
|
|
- if ((authInfo as any).address.city.length > 0) {
|
|
|
- city = (authInfo as any).address.city
|
|
|
- }
|
|
|
- else if ((authInfo as any).address.province.length > 0) {
|
|
|
- city = (authInfo as any).address.province
|
|
|
- }
|
|
|
- else if ((authInfo as any).address.country.length > 0) {
|
|
|
- city = (authInfo as any).address.country
|
|
|
+ if ((authInfo as any).address){
|
|
|
+ if ((authInfo as any).address.city.length > 0) {
|
|
|
+ city = (authInfo as any).address.city
|
|
|
+ }
|
|
|
+ else if ((authInfo as any).address.province.length > 0) {
|
|
|
+ city = (authInfo as any).address.province
|
|
|
+ }
|
|
|
+ else if ((authInfo as any).address.country.length > 0) {
|
|
|
+ city = (authInfo as any).address.country
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ city = t('feature.track_time_duration.third_ring.unknown')
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
city = t('feature.track_time_duration.third_ring.unknown')
|