// store/index.js
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);
// import { getConfigByKey } from '@/api/index.js'

const store = new Vuex.Store({
  state: {
	coureLogin: uni.getStorageSync('coureLogin') || 0,
	 wsDanmuUrl: 'wss://userapp.cqsft.vip', // 弹幕评论接口地址
	 //红包领取规则:
	 answerType: 1, //红包领取规则 0：完课且最后一分钟（第二次无需最后一分钟）， 1:按完课百分比答题领红包
	 isSpare:1, // 0，主要小程序，1：备选
	 uploadFile: 'https://userapp.cqsft.vip',
	imgpath: 'https://beiliyo-2025.obs.cn-north-4.myhuaweicloud.com',//倍力优图片请求地址
	logoname:'芳华臻选生活馆',
	appid:'wx776d6bd6848eec49',
  },
  getters: {
    coureLogin: (state) => state.coureLogin,
  },
  mutations: {
    setCount(state, value) {
      state.count = value;
    },
	setCoureLogin(state, payload) {
		uni.setStorageSync('coureLogin', payload);
		state.coureLogin = payload;
	}
  },
  actions: {
  }
});

export default store