import * as commonUtils             from '@/utils/common';

export default {
    methods: {
        // 缓存数据处理
        handleCache(code, target, data) {
            let backdata = null;
            switch (code) {
                case 'get':
                    backdata = commonUtils.getCache(...target);
                    break;
            
                case 'save':
                    // 设置缓存
                    commonUtils.saveCache(...target, data);
                    break;

                case 'remove':
                    commonUtils.removeCache(target[0]);
                    break;
            }
            return backdata;
        },
        
    },

};