From 0da6ffc479eceef01478c6aaf6621fe293e3f7c3 Mon Sep 17 00:00:00 2001
From: lxl <lixuliang_hd@126.com>
Date: 星期三, 26 十月 2022 09:53:19 +0800
Subject: [PATCH] 菜单

---
 src/store/index.js |   50 +++++++++++++++++++++++++++++++++++---------------
 1 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/src/store/index.js b/src/store/index.js
index 088eb10..c5603c5 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,8 +1,8 @@
 import Vue from 'vue';
 import Vuex from 'vuex';
-import { getToken, setToken, removeToken } from "@/utils/auth";
-import { Loading, Message } from "element-ui";
-import { login, getPublicKey } from "@/api/api";
+import { getToken, setToken, removeToken } from '@/utils/auth';
+import { Loading, Message } from 'element-ui';
+import { login, getPublicKey } from '@/api/api';
 
 var encrypt = new JSEncrypt();
 Vue.use(Vuex);
@@ -11,18 +11,29 @@
   state: {
     catalogueName: '',
     cataNode: {},
+    lang: 'zh',
+    menuNode: {},
     verCateNode: {},
     verCateNodes: {},
     styleDirCateNodes: {},
     styleDepCateNodes: {},
+    iframeMsg: '',
     token: getToken(),
     //璇锋眰璁℃暟
     apiCount: 0,
     //loading瀹炰緥
     loadingInstance: null,
-    key: null
+    key: null,
+    //绯荤粺鐩戞帶WebSocket
+    ws: null,
+    //鏉冮檺鍚堥泦
+    permsEntity: [],
   },
   mutations: {
+    //鑾峰彇鏉冮檺鍚堥泦
+    getPermsEntity() {
+      state.permsEntity = msg
+    },
     // 鑾峰彇瀹屾暣闈㈠寘灞戣矾寰�
     changeCata(state, msg) {
       state.catalogueName = msg;
@@ -30,6 +41,16 @@
     // 鑾峰彇鐐瑰嚮鐨勭洰褰曠偣瀵硅薄
     changeNode(state, msg) {
       state.cataNode = msg;
+    },
+    changeLang(state, msg) {
+      state.lang = msg;
+    },
+    getIframe(state, msg) {
+      state.iframeMsg = msg;
+    },
+    changeName(state, msg) {
+      state.menuNode = msg;
+      // console.log(msg);
     },
     verChangeNode(state, msg) {
       state.verCateNode = msg;
@@ -48,8 +69,8 @@
     START_LOADING(state, msg) {
       state.loadingInstance = Loading.service({
         lock: true,
-        text: msg ? msg : "鍔犺浇涓�...",
-        background: "rgba(0, 0, 0, 0.7)",
+        text: msg ? msg : '鍔犺浇涓�...',
+        background: 'rgba(0, 0, 0, 0.7)',
       });
     },
     /* 鍏抽棴loading */
@@ -59,13 +80,13 @@
     },
     /* 鏇存柊璇锋眰绾跨▼姹� */
     UPDATE_API_COUNT(state, handle) {
-      if (handle == "add") {
+      if (handle == 'add') {
         state.apiCount++;
-        this.commit("START_LOADING");
+        this.commit('START_LOADING');
       } else {
         state.apiCount--;
         if (state.apiCount <= 0) {
-          this.commit("CLOSE_LOADING");
+          this.commit('CLOSE_LOADING');
         }
       }
     },
@@ -83,7 +104,7 @@
       return new Promise((resolve, reject) => {
         var data = {
           uid: encrypt.encrypt(userInfo.uid),
-          pwd: encrypt.encrypt(userInfo.pwd)
+          pwd: encrypt.encrypt(userInfo.pwd),
         };
         login(data)
           .then((response) => {
@@ -91,11 +112,11 @@
             if (data.code !== 200) {
               return Message({
                 message: data.msg,
-                type: "error",
+                type: 'error',
                 duration: 5 * 1000,
               });
             }
-            commit("SET_TOKEN", data.result.token);
+            commit('SET_TOKEN', data.result.token);
             setToken(data.result.token);
             resolve(data);
           })
@@ -105,12 +126,11 @@
       });
     },
     getpublickey({ commit, state }, userInfo) {
-
       return new Promise((resolve, reject) => {
         getPublicKey(userInfo)
           .then((response) => {
             const data = response;
-            commit("SET_KEY", data.result);
+            commit('SET_KEY', data.result);
 
             encrypt.setPublicKey(data.result); // 璁剧疆鍏挜
             resolve();
@@ -119,7 +139,7 @@
             reject(error);
           });
       });
-    }
+    },
   },
   modules: {},
 });

--
Gitblit v1.9.3