
import {
	LOGIN_STATUS,
	ISPAY,
	UID,
	USER_INFO,
	USER_ADDRESS,
	isFiveClick
} from '../../config/cache';
import Cache from '../../utils/cache';

const state = {
	token: Cache.get(LOGIN_STATUS) || false,
	ISPAY: Cache.get(ISPAY) || '',
};

const mutations = {
	LOGIN(state, opt) {
		state.token = opt.token;
	},
	UPDATE_LOGIN(state, token) {
		state.token = token;
		Cache.set(LOGIN_STATUS, token);
	},
	SETALL_PAT(state, data) {
		state.ISPAY = data;
		Cache.set(ISPAY, data);
	}
};

const actions = {
};

export default {
	state,
	mutations,
	actions
};
