配置文件
This commit is contained in:
19
src/App.vue
19
src/App.vue
@@ -19,18 +19,17 @@
|
||||
import { getDefaultLocal } from '@/api/system/user';
|
||||
const lang = localStorage.getItem('lang')
|
||||
|
||||
const _getDefaultLocal = () => {
|
||||
getDefaultLocal().then(res => {
|
||||
console.log('res', res)
|
||||
if (lang !== res.defaultLocal) {
|
||||
localStorage.setItem('lang', res.defaultLocal)
|
||||
localStorage.setItem('defaultCoinUnit', res.defaultCoinUnit)
|
||||
location.reload()
|
||||
}
|
||||
})
|
||||
|
||||
const init = async () => {
|
||||
const defaultLocal = await getDefaultLocal()
|
||||
if (lang !== defaultLocal.defaultLocal) {
|
||||
localStorage.setItem('lang', defaultLocal.defaultLocal)
|
||||
localStorage.setItem('defaultCoinUnit', defaultLocal.defaultCoinUnit)
|
||||
location.reload()
|
||||
}
|
||||
}
|
||||
|
||||
_getDefaultLocal()
|
||||
init()
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user