中英文
This commit is contained in:
parent
3874f6ab2e
commit
73eceefbf0
@ -29,6 +29,7 @@ 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
|
||||
|
@ -1,7 +1,7 @@
|
||||
import router from '@/router';
|
||||
import store from '@/store';
|
||||
import { LiveList, LivelistInfo, LoginData, UserInfo } from '@/types';
|
||||
import { saveValue } from '@/utils/common';
|
||||
import { getValue, saveValue } from '@/utils/common';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { del, get, post, put, setToken } from './base'
|
||||
|
||||
@ -1014,11 +1014,21 @@ export async function luzhi(roomid: string){
|
||||
export async function getaddr() {
|
||||
const res = await get<any>('ip');
|
||||
const gj = res.data.address.split("|")[0];
|
||||
if(gj == "CN"){
|
||||
return ["zh", "中文", '人民币¥'];
|
||||
}else {
|
||||
return ['en', 'English', '美元$']
|
||||
const lan = getValue("Lanvuage");
|
||||
if(lan != null && lan){
|
||||
if(gj == "CN"){
|
||||
return ['人民币¥'];
|
||||
}else {
|
||||
return [ '美元$']
|
||||
}
|
||||
}else{
|
||||
if(gj == "CN"){
|
||||
return ["zh", "中文", '人民币¥'];
|
||||
}else {
|
||||
return ['en', 'English', '美元$']
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// export async function StopMCUMixTranscode(roomid: number) {
|
||||
|
@ -307,7 +307,7 @@ export default defineComponent({
|
||||
languagelist.value=await getlanguages()
|
||||
console.log(routes.path)
|
||||
nowroute.value=routes.path
|
||||
lan.locale.value = userinfo.value.languageValue
|
||||
// lan.locale.value = userinfo.value.languageValue
|
||||
})
|
||||
|
||||
function zonechange(e?: any){
|
||||
|
@ -2,7 +2,7 @@ import { getValue } from '@/utils/common';
|
||||
import axios from 'axios'
|
||||
axios.defaults.baseURL = 'https://case.sy-my.net/beelink/public/home/';
|
||||
axios.defaults.headers.common['Authorization'] = "Bearer " + getValue("token");
|
||||
axios.defaults.headers.common['Language'] = "Bearer " + getValue("Lanvuage");
|
||||
axios.defaults.headers.common['Language'] = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage");
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
|
||||
export default axios
|
@ -10,10 +10,10 @@ getset().then((res: any)=>{
|
||||
en.shichangtishi = `Minimum ${res.lowerLimit} person, maximum ${res.numberCeiling} people`
|
||||
zh.tixianzhu = `注:每笔提现收取${res.sxf}服务费,最低${ res.symbol + res.minmoney }`
|
||||
en.tixianzhu = `Note: ${res.sxf} service fee will be charged for each withdrawal, with a minimum of ${ res.symbol + res.minmoney }`
|
||||
const i18n = geti18n();
|
||||
const loc = i18n.locale.value;
|
||||
i18n.locale.value = '';
|
||||
i18n.locale.value = loc;
|
||||
// const i18n = geti18n();
|
||||
// const loc = i18n.locale.value;
|
||||
// i18n.locale.value = '';
|
||||
// i18n.locale.value = loc;
|
||||
console.log('i18n')
|
||||
|
||||
})
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { getaddr, userinfo } from '@/api';
|
||||
import { getValue } from '@/utils/common';
|
||||
import { setLanvuage } from '@/api/base';
|
||||
import { getValue, saveValue } from '@/utils/common';
|
||||
import { isProxy } from 'vue';
|
||||
import { createStore } from 'vuex'
|
||||
|
||||
@ -64,13 +65,32 @@ export default createStore({
|
||||
setLanguage(state, data){
|
||||
const split = new Date().toString().split(" ");
|
||||
const timeZoneFormatted = split[split.length - 2] + " " + split[split.length - 1];
|
||||
state.userinfo.language = data[1] // English 中文
|
||||
state.userinfo.languageValue = data[0] // 'en' 'zh'
|
||||
state.userinfo.zoneStr = timeZoneFormatted;
|
||||
state.userinfo.currency = data[2];
|
||||
const lan = getValue("Lanvuage");
|
||||
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];
|
||||
}else{
|
||||
console.log(data, 111)
|
||||
state.userinfo.language = data[1] // English 中文
|
||||
state.userinfo.languageValue = data[0] // 'en' 'zh'
|
||||
state.userinfo.zoneStr = timeZoneFormatted;
|
||||
state.userinfo.currency = data[2];
|
||||
saveValue("Lanvuage", data[0]);
|
||||
if( data[0] != 'zh'){
|
||||
location.reload()
|
||||
}
|
||||
// setLanvuage(data[0]);
|
||||
}
|
||||
|
||||
},
|
||||
setWlan(state){
|
||||
state.userinfo.languageValue = getValue("Lanvuage")
|
||||
const lan = getValue("Lanvuage");
|
||||
if(lan != null && lan){
|
||||
state.userinfo.languageValue = !getValue("Lanvuage") ? 'zh' : getValue("Lanvuage");
|
||||
state.userinfo.language = (!getValue("Lanvuage") ? 'zh' : getValue("Lanvuage")) == 'zh' ? '中文' : 'English';
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
Loading…
Reference in New Issue
Block a user