123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import Vue from 'vue'
- import Vuex from 'vuex'
- import user from './model/user'
- import i18n from '../libs/i18n/index.js'
- Vue.use(Vuex)
- const store = new Vuex.Store({
- state: {
- baseURL: 'https://polkep.xyz',
- urlFile: '/index',
- loginInterceptor: false,
-
- weichatInfo: {},
- weichatObj: '',
-
- langList: [
- {
- value: 'en',
- label: 'English'
- },
- {
- value: 'cn',
- label: '简体中文'
- },
- {
- value: 'tw',
- label: '繁體中文'
- }
- ],
- lang:uni.getStorageSync('lang')||'tw',
- },
- mutations: {
-
- setWeiChatInfo(state, provider) {
- state.weichatInfo = provider;
- },
-
- setWeiChatObj(state, provider) {
- state.weichatObj = provider;
- },
- LANG(state, data) {
- uni.setStorageSync('lang', data)
- i18n.locale = data
- state.lang = data
- },
- },
- modules: {
- user
- },
- actions: {
-
- setLang({ commit }, data) {
- commit('LANG', data)
-
- },
- }
- })
- export default store
|