From 74bcf0374dad94d352b68f10e2e3d6e0ebc2c9dc Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Sun, 07 Apr 2024 12:32:13 +0800
Subject: [PATCH] 1

---
 src/store/index.js |   47 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/src/store/index.js b/src/store/index.js
index 4c83cf5..eda41e4 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,33 +1,54 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
+import Vue from "vue";
+import Vuex from "vuex";
 // import getters from './getters'
 // import actions from './actions'
 // import mutations from './mutations'
 
-Vue.use(Vuex)
+Vue.use(Vuex);
 
-const state = {
-  className: 'black',
-  userInfo: { // 用户信息
+let state = {
+  className: "black",
+  theme: "red",
+  userInfo: {
+    // 用户信息
   },
   user: {},
   bankInfo: {
-    bankNo: ''
+    bankNo: ""
   },
   hide: false,
-  select: '/home', // 菜单选择
-  token: 'USER62CCF5221CD752269D47681374DD0916',
-  settingForm: { // 产品配置
+  select: "/home", // 菜单选择
+  token: window.localStorage.getItem("USERTOKEN") || null,
+  elAlertShow: false,
+  elAlertText: "",
+  dialogVisible: false,
+  elAlertType: "warning",
+  settingForm: {
+    // 产品配置
     futuresDisplay: false,
     indexDisplay: false,
     kcStockDisplay: false,
     stockDisplay: false
   }
-}
+};
 
 export default new Vuex.Store({
   state,
   actions: {},
-  mutations: {},
+  mutations: {
+    undataToken(state, token) {
+      state.token = token || null;
+    },
+    elAlertShow(state, payload) {
+      state.elAlertShow = payload.elAlertShow;
+      state.elAlertText = payload.elAlertText;
+      if (payload.elAlertType) {
+        state.elAlertType = payload.elAlertType;
+      }
+    },
+    dialogVisible(state, payload) {
+      // state.dialogVisible = payload;
+    }
+  },
   getters: {}
-})
+});

--
Gitblit v1.9.3