区号自动获取
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { getaddr, userinfo } from '@/api';
|
||||
import { setLanvuage } from '@/api/base';
|
||||
import { getValue, saveValue } from '@/utils/common';
|
||||
import { geti18n } from '@/utils/i18n';
|
||||
import { isProxy } from 'vue';
|
||||
import { createStore } from 'vuex'
|
||||
|
||||
@@ -62,6 +63,11 @@ export default createStore({
|
||||
symbol: "",
|
||||
timeCeiling: "",
|
||||
timeLowerLimit: "",
|
||||
},
|
||||
qh: {
|
||||
code: "86",
|
||||
ename: "China",
|
||||
name: "中国",
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
@@ -81,19 +87,20 @@ export default createStore({
|
||||
const split = new Date().toString().split(" ");
|
||||
const timeZoneFormatted = split[split.length - 2] + " " + split[split.length - 1];
|
||||
const lan = getValue("Lanvuage");
|
||||
state.qh = data.qh.data;
|
||||
if(lan != null && lan){
|
||||
// state.userinfo.language = data[1] // English 中文
|
||||
// state.userinfo.languageValue = data[0] // 'en' 'zh'
|
||||
state.userinfo.zoneStr = timeZoneFormatted;
|
||||
state.userinfo.currency = data[0];
|
||||
state.userinfo.currency = data.hb;
|
||||
}else{
|
||||
console.log(data, 111)
|
||||
state.userinfo.language = data[1] // English 中文
|
||||
state.userinfo.languageValue = data[0] // 'en' 'zh'
|
||||
state.userinfo.language = data.yyx // English 中文
|
||||
state.userinfo.languageValue = data.yy // 'en' 'zh'
|
||||
state.userinfo.zoneStr = timeZoneFormatted;
|
||||
state.userinfo.currency = data[2];
|
||||
saveValue("Lanvuage", data[0]);
|
||||
if( data[0] != 'zh'){
|
||||
state.userinfo.currency = data.hb;
|
||||
saveValue("Lanvuage", data.yx);
|
||||
if( data.yx != geti18n().$s()){
|
||||
location.reload()
|
||||
}
|
||||
// setLanvuage(data[0]);
|
||||
|
||||
Reference in New Issue
Block a user