import { defineStore } from "pinia";


export const useFiltersStore =  defineStore("user", {
  state() {
    return {
      loginFlag: false,
      token: "",
      refresh_token:"",
      time:"",
      memberInfo:{},
      siteLogo:'/images/admin/setting/u57SOSFwenNMgOSavog.png',
      uuid:'',
      googleTranslateStatus: '0'
    };
  },
  persist: true, // 开启数据持久化，所有store数据将被持久化到指定仓库
  actions: {
    setGoogleTanslateStatus(val) {
      this.googleTranslateStatus = val;
    },
    setLoginStatus(val) {
      this.loginFlag = val;
    },
    setToken(val) {
      this.token = val;
    },
    setMemberInfo(val) {
        this.memberInfo = val;
    },
    setRefreshToken(val) {
      this.refresh_token = val;
    },
    setTime(val) {
      this.time = val;
    },
    setSiteLogo(val) {
      this.siteLogo = val;
    },
    setUUid(val) {
      this.uuid = val;
    },
  },
  getters: {
    getGoogleTanslateStatus() {
      return this.googleTranslateStatus;
    },
    getLoginFlag() {
      return this.loginFlag;
    },
    getToken() {
      return this.token;
    },
    getMemberInfo() {
        return this.memberInfo;
    },
    getRefreshToken() {
      return this.refresh_token;
    },
    getTime() {
      return this.time;
    },
    getSiteLogo() {
      return this.siteLogo;
    },
    getUUid(){
      return this.uuid;
    }
  },
});
