修复bug
This commit is contained in:
@@ -10,6 +10,7 @@ import * as R from 'ramda'
|
||||
import {EventEnum} from "@/constant/enums";
|
||||
import {dayjs} from '@/plugin'
|
||||
import {useConfigStore} from "@/store";
|
||||
import {i18n} from "@/locale";
|
||||
|
||||
export const useUserStore = defineStore(
|
||||
'user',
|
||||
@@ -173,9 +174,13 @@ export const useUserStore = defineStore(
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
const {locale} = useI18n()
|
||||
function getCityName(latitude: number, longitude: number) {
|
||||
const url = `https://maps.googleapis.com/maps/api/geocode/json?latlng=${latitude},${longitude}&key=${Config.googleMapKey}&language=${locale.value === 'zh-Hans' ? 'zh-CN' : locale.value}`;
|
||||
const currentLocale =
|
||||
typeof i18n.global.locale === 'string'
|
||||
? i18n.global.locale
|
||||
: i18n.global.locale.value
|
||||
const language = currentLocale === 'zh-Hans' ? 'zh-CN' : currentLocale
|
||||
const url = `https://maps.googleapis.com/maps/api/geocode/json?latlng=${latitude},${longitude}&key=${Config.googleMapKey}&language=${language}`;
|
||||
|
||||
uni.request({
|
||||
url,
|
||||
|
||||
Reference in New Issue
Block a user