添加了区号和修复多语言

This commit is contained in:
luyuan 2020-11-10 15:15:31 +08:00
parent b0a6592373
commit 9e128db2c6
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
4 changed files with 12 additions and 6 deletions

View File

@ -21,6 +21,7 @@ export default defineComponent({
setup(){
console.log(i18ninit)
const len = provideI18n(i18ninit);
len.locale.value = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage");
if(getValue('token')){
store.commit("login", true)
store.dispatch("setUserInfo");
@ -29,7 +30,6 @@ export default defineComponent({
console.log('ip')
store.dispatch("getip");
store.commit('setWlan')
len.locale.value = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage");
router.push("/")
}
const zh = zhCN

View File

@ -320,14 +320,14 @@ export default defineComponent({
}
function setlanguage(e?: any){
console.log(e)
saveValue("Lanvuage", e)
if(store.state.islogin){
editsystemsetting({language:e})
}else {
saveValue("Lanvuage", e)
location.reload();
// setLanvuage(e)
}
lan.locale.value = e
// lan.locale.value = e
}
function toindex(){

View File

@ -124,6 +124,7 @@ import store from '@/store';
import router from '@/router';
import { useI18n } from '@/utils/i18n';
import { editsystemsetting, getlanguages } from '@/api';
import { saveValue } from '@/utils/common';
export default defineComponent({
components: {
NavBottom
@ -153,8 +154,13 @@ export default defineComponent({
}
function setlanguage(e?: any){
console.log(e)
editsystemsetting({language:e})
lan.locale.value = e
saveValue("Lanvuage", e)
if(store.state.islogin){
editsystemsetting({language:e})
}else {
location.reload();
// setLanvuage(e)
}
}
return {
languagelist,

View File

@ -229,7 +229,7 @@
</div>
<div class="input-box phone-box">
<div class="label">{{ lan.$t("shoujihao") }}</div>
<div class="phone">{{ userinfo.mobile }}</div>
<div class="phone">{{ userinfo.code }}{{ userinfo.mobile }}</div>
<div class="update-btn" @click="togglePhoneModal(true)">
{{ lan.$t("genghuanshoujihao") }}
</div>