import { defineStore } from 'pinia'

import { getShopInfo } from '@/services/shop'

export const useShopStore = defineStore('shop', {
    state: () => {
      return {
        session_id: '',
        domain: '',
        sso_domain: '',
        config: {
          service_phone: '',
          service_email: '',
        }
      }
    },
    getters: {
    },
    actions: {
      async getShopInfo(){
        let res = await getShopInfo()
        this.session_id = res.data.session_id
        this.config = res.data.shop_config
      }
    },
})