Bläddra i källkod

添加用户id,删除无用vuex模块

zhangyu 5 år sedan
förälder
incheckning
d53d329b92

+ 2 - 1
src/api/model/file.js

@@ -1,7 +1,8 @@
 import httputils from '@/api/scan/httpUtil'
 import { Message } from 'element-ui';
-const baseUrl = '/modelapi';
 import axios from 'axios'
+const baseUrl = '/modelapi';
+
 let api = {
     // 新建模型文件夹
     /**

+ 4 - 26
src/framework/layout/layout-store.js

@@ -17,7 +17,7 @@ export default {
         projectId: '',
         projects: [],
         breadcrumb: [],
-        secret: "", //密码
+        secret: "", //项目密码
         userId: "", //用户id
     },
     getters: {
@@ -87,33 +87,11 @@ export default {
             return new Promise((resolve, reject) => {
                 frameworkApi.loadUserInfo().then(resp => {
                     console.log(resp)
-                    // if (resp.result == 'success') {
-                    //     state.userInfo = { username: resp.username }
-                    //     storage.set('user_name', resp.username)
-                    //     state.permissions = {}
-                    //     if (resp.permissions) {
-                    //         resp.permissions.forEach(p => (state.permissions[p] = true))
-                    //     }
-                    //     state.projects = []
-                    //     if (resp.projects) {
-                    //         if(resp.projects[0] && resp.projects[0].projId) {
-                    //             state.projectId = resp.projects[0].projId
-                    //             state.secret = resp.projects[0].secret?resp.projects[0].secret:""
-                    //         }
-                    //         resp.projects.forEach(proj =>
-                    //             state.projects.push({
-                    //                 id: proj.projId,
-                    //                 name: proj.projLocalName,
-                    //                 pwd: proj.secret?proj.secret:""
-                    //             })
-                    //         )
-                    //     }
-                    // } else {
                     if (resp.Result == 'success') {
-                        state.userInfo = { username: resp.Username, userId: resp.Userid }
-                        state.userId = resp.Userid
+                        state.userInfo = { username: resp.Username, userId: resp.UserId }
+                        state.userId = resp.UserId
                         storage.set('user_name', resp.Username)
-                        storage.set('user_id', resp.Userid)
+                        storage.set('user_id', resp.UserId)
                         state.permissions = {}
                         if (resp.Permissions) {
                             resp.Permissions.forEach(p => (state.permissions[p] = true))

+ 0 - 2
src/store/index.js

@@ -3,7 +3,6 @@ import Vuex from 'vuex'
 import storage from '@/framework/utils/storage'
 import layout from '@/framework/layout/layout-store'
 import project from "./modules/project"
-import peojMess from "./modules/proMess"
 import alarm from './modules/alarm'
 Vue.use(Vuex)
 const KEY_LAST_ROUTE = 'last_route'
@@ -38,7 +37,6 @@ export default new Vuex.Store({
     modules: {
         layout,
         project,
-        peojMess,
         alarm
     }
 })

+ 3 - 3
src/store/modules/alarm.js

@@ -20,9 +20,9 @@ const alarm = {
           state.spaceNameObj = spaceNameObj
       },
     //   空间code值dict
-        SPACE_CODE_OBJ(state, spaceCodeObj) {
-            state.spaceCodeObj = spaceCodeObj
-        }
+      SPACE_CODE_OBJ(state, spaceCodeObj) {
+          state.spaceCodeObj = spaceCodeObj
+      }
   }
 }
 export default alarm;

+ 0 - 29
src/store/modules/proMess.js

@@ -1,29 +0,0 @@
-const project_mess = {
-    namespaced: true,
-    state: {
-        projectId: "", //项目id
-        secret: "", //数据源id
-        userId: "test", //数据源类型
-    },
-    mutations: {
-        set_project(state, val) {
-            state.projectId = val
-        },
-        set_secret(state, val) {
-            state.secret = val
-        },
-        set_userId(state, val) {
-            state.userId = val
-        }
-    },
-    actions: {
-
-    },
-    getters: {
-        projectId: state => state.projectId,
-        userId: state => state.userId,
-        secret: state => state.secret
-    }
-}
-
-export default project_mess