张恒

更新依赖,追加用户信息

......@@ -6727,14 +6727,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -6754,8 +6752,7 @@
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
......@@ -6903,7 +6900,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -6996,8 +6992,7 @@
"npm-normalize-package-bin": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"npm-packlist": {
"version": "1.4.8",
......@@ -14932,9 +14927,9 @@
"dev": true
},
"vuex": {
"version": "3.3.0",
"resolved": "https://registry.npm.taobao.org/vuex/download/vuex-3.3.0.tgz",
"integrity": "sha1-ZltGMOoTRzFxOfzFy0laqz7F5RM="
"version": "3.4.0",
"resolved": "https://registry.npm.taobao.org/vuex/download/vuex-3.4.0.tgz",
"integrity": "sha1-IMwIYGLXUHafzh/rs05/zurr3kU="
},
"vuex-electron": {
"version": "1.0.3",
......
......@@ -83,7 +83,7 @@
"vue": "^2.6.11",
"vue-electron": "^1.0.6",
"vue-router": "^3.1.6",
"vuex": "^3.3.0",
"vuex": "^3.4.0",
"vuex-electron": "^1.0.3"
},
"devDependencies": {
......
const user = {
state: {
token: JSON.parse(localStorage.getItem('token')),
name: JSON.parse(localStorage.getItem('name')),
roles: JSON.parse(localStorage.getItem('roles'))
// token: JSON.parse(localStorage.getItem('token')),
// name: JSON.parse(localStorage.getItem('name')),
// roles: JSON.parse(localStorage.getItem('roles'))
token: 'admin',
name: 'Super Admin',
roles: ['admin']
},
mutations: {
......@@ -22,7 +25,9 @@ const user = {
actions: {
// 登录
Login ({ commit }, data) {
Login ({
commit
}, data) {
return new Promise((resolve, reject) => {
console.log('这是传过来的登录信息', data)
commit('SET_TOKEN', 'admin')
......@@ -33,7 +38,10 @@ const user = {
},
// 登出
LogOut ({ commit, state }) {
LogOut ({
commit,
state
}) {
return new Promise((resolve, reject) => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
......@@ -42,7 +50,9 @@ const user = {
},
// 前端 登出
FedLogOut ({ commit }) {
FedLogOut ({
commit
}) {
return new Promise(resolve => {
commit('SET_TOKEN', '')
resolve()
......