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