Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Former-commit-id: abe64e8538ecdc034c1e3953bbce3d19d76bc966 [formerly abe64e8538ecdc034c1e3953bbce3d19d76bc966 [formerly abe64e8538ecdc034c1e3953bbce3d19d76bc966 [formerly abe64e8538ecdc034c1e3953bbce3d19d76bc966 [formerly 9a71121 [formerly fc1ec7167f884c29ff67aee74f6c895c67dd0591]]]]]
Former-commit-id: fde659b
Former-commit-id: f71e86b
Former-commit-id: f2b3c3761306ddfab87175bd89982b813fd6f9fe [formerly 03855e9ddfe90ba5462e3bb52b0e41f3cd3cd544]
Former-commit-id: ad6cdff69b7316b170e9b37dffadac71e3da0eb3
Former-commit-id: a8f081ba6763e0ecdd21903e90d97f349e987856
Former-commit-id: d34fd2aad2f858c8f0c359e6a55b395e4ce2cb98
Former-commit-id: e4760a4f0b6056ec36661e3d23f6ce59119eb344
Former-commit-id: b01f42f6e11d1f37b2690ffcf45289434a95ec8e
  • Loading branch information
FairyEver committed Jan 16, 2019
2 parents 0ae6da2 + 80c68f9 commit b8497d5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d2-admin",
"version": "1.6.11",
"version": "1.6.12",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
Expand Down
2 changes: 1 addition & 1 deletion src/layout/header-aside/components/header-user/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<el-dropdown size="small" class="d2-mr">
<span class="btn-text">你好 {{info.name}}</span>
<span class="btn-text">{{info.name ? `你好 ${info.name}` : '未登录'}}</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="logOff">
<d2-icon name="power-off" class="d2-mr-5"/>
Expand Down
6 changes: 3 additions & 3 deletions src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import business from './modules/business'

import layoutHeaderAside from '@/layout/header-aside'

const meta = { auth: true }

/**
* 在主框架内显示
*/
Expand All @@ -25,7 +23,9 @@ const frameIn = [
{
path: 'index',
name: 'index',
meta,
meta: {
auth: true
},
component: () => import('@/pages/index')
},
// 刷新页面 必须保留
Expand Down
6 changes: 0 additions & 6 deletions src/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,5 @@ export default {
// 是否默认开启页面切换动画
transition: {
active: true
},
// 在读取持久化数据失败时默认用户信息
user: {
info: {
name: 'Ghost'
}
}
}
6 changes: 4 additions & 2 deletions src/store/modules/d2admin/modules/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ export default {
* @param {Object} param vm {Object} vue 实例
* @param {Object} param confirm {Boolean} 是否需要确认
*/
logout ({ commit }, { vm, confirm = false }) {
logout ({ commit, dispatch }, { vm, confirm = false }) {
/**
* @description 注销
*/
function logout () {
async function logout () {
// 删除cookie
util.cookies.remove('token')
util.cookies.remove('uuid')
// 清空 vuex 用户信息
await dispatch('d2admin/user/set', {}, { root: true })
// 跳转路由
vm.$router.push({
name: 'login'
Expand Down
7 changes: 2 additions & 5 deletions src/store/modules/d2admin/modules/user.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// 设置文件
import setting from '@/setting.js'

export default {
namespaced: true,
state: {
// 用户信息
info: setting.user.info
info: {}
},
actions: {
/**
Expand Down Expand Up @@ -38,7 +35,7 @@ export default {
state.info = await dispatch('d2admin/db/get', {
dbName: 'sys',
path: 'user.info',
defaultValue: setting.user.info,
defaultValue: {},
user: true
}, { root: true })
// end
Expand Down

0 comments on commit b8497d5

Please sign in to comment.