import IMSDK from "openim-uniapp-polyfill";
import {
	businessConfig
} from "@/api/login";
import {
	filterEmptyValue
} from "@/util/common";

const state = {
	config: {}
};

const mutations = {
	SET_CONFIG(state, info) {
		state.config = {
			...info,
		};
	}
};

const actions = {
	async getConfig({
		commit
	}) {
		try {
			const data = await businessConfig();
			//filterEmptyValue(businessData);
			commit("SET_CONFIG", data);
		} catch (e) {
			console.log(e);
			uni.$u.toast("获取系统信息失败");
		}
	},

};

export default {
	namespaced: true,
	state,
	mutations,
	actions,
};