1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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:window.location.protocol + "//" + window.location.host,
-
-
- baseURL: 'https://xinkong.vwetdd.cn',
-
- urlFile: '/index',
- loginInterceptor: false,
-
- weichatInfo: {},
- weichatObj: '',
- isShowIllegality:true,
-
-
- isShowIllegality:false,
-
- langList: [
- {
- value: 'en',
- label: 'English'
- },
- {
- value: 'cn',
- label: '简体中文'
- },
- {
- value: 'tw',
- label: '繁體中文'
- }
- ],
- lang:uni.getStorageSync('lang')||'cn',
- },
- mutations: {
-
-
- setHttp(state, provider){
- state.baseURL = provider
- },
-
-
- 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
- },
-
- changeState(state, provider){
- console.log(provider,'provider');
- state.isShowIllegality = provider;
- }
- },
- modules: {
- user
- },
- actions: {
-
- setLang({ commit }, data) {
- commit('LANG', data)
-
- },
- }
- })
- export default store
|