import { setLang } from "@/utils/auth"
import context from "@/main"
const state = {
lang: 'cn'
}
const mutations = {
SET_NEW_LANGUAGE: (state, command) => {
switch (command) {
case 'ZH':
context.$i18n.locale = 'cn'
state.lang = 'cn'
setLang(state.lang)
break;
case 'EN':
context.$i18n.locale = 'en'
state.lang = 'en'
setLang(state.lang)
break;
case 'JP':
context.$i18n.locale = 'ja'
state.lang = 'ja'
setLang(state.lang)
break;
}
},
GET_LIST: (state, val) => {
state.idsList = val
}
}
const actions = {}
export default {
namespaced: true,
state,
mutations,
actions
}