1
PC-20250623MANY\Administrator
2025-09-15 cd7857e2fced79ca20ad1903d03b32b96da04b79
src/store/index.js
@@ -1,6 +1,9 @@
import { getUserInfodata } from "@/axios/api";
import { getUserInfodata, getInfoSite } from "@/axios/api";
import Vue from "vue";
import Vuex from "vuex";
import { Toast } from "vant";
import i18n from "@/locales/index.js";
import deTh from "@/utils/deTh.js";
// import getters from './getters'
// import actions from './actions'
// import mutations from './mutations'
@@ -38,7 +41,7 @@
  actions: {
    async setUseInfo({ commit }) {
      let data = await getUserInfodata();
      if (data.status === 0) {
      if (data.status == 0) {
        commit("SET_USE_INFO", data.data);
      } else {
        commit("elAlertShow", {
@@ -46,7 +49,19 @@
          elAlertText: data.msg
        });
      }
    }
    },
    // 触发客服提示
    CustomerService: deTh.throttle(async function() {
      // Toast(i18n.t("kf1"));
      let data = await getInfoSite();
      if (data.status === 0) {
        let onlineService = data.data.onlineService;
        window.open(onlineService, "_blank");
      } else {
        Toast(i18n.t("kf2"));
      }
    })
  },
  mutations: {
    SET_USE_INFO(state, useInfo) {