import { defineStore } from 'pinia'

import { getAppImgs } from '@/api/system/linksApi'

/**
 * 授权仓库
 */
export const useImageStore = defineStore('useImageStore', {
	state: () => {
		return {
			data: []
		}
	},
	//计算字段
	getters: {

	},
	//方法
	actions: {
		async load() {
			this.data = await getAppImgs();
		},
		img(key) {
			return this.data.find(a => a.title == key)?.img || '';
		},
		obj(key) {
			return this.data.find(a => a.title == key);
		}





	},
	unistorage: false // 开启后对 state 的数据读写都将持久化

})