Merge branch 'develop'
Former-commit-id: abe64e8538ecdc034c1e3953bbce3d19d76bc966 [formerly abe64e8538ecdc034c1e3953bbce3d19d76bc966 [formerly abe64e8538ecdc034c1e3953bbce3d19d76bc966 [formerly abe64e8538ecdc034c1e3953bbce3d19d76bc966 [formerly 9a71121cd291f4f012413a600ff04fc57bb8ba95 [formerly fc1ec7167f884c29ff67aee74f6c895c67dd0591]]]]] Former-commit-id: fde659b3e09aafaa3d0a06de2f39ca6f121a2d88 Former-commit-id: f71e86bdff750a7626de2711d28da957d98b75f8 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
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "d2-admin",
|
||||
"version": "1.6.11",
|
||||
"version": "1.6.12",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve --open",
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -10,8 +10,6 @@ import business from './modules/business'
|
||||
|
||||
import layoutHeaderAside from '@/layout/header-aside'
|
||||
|
||||
const meta = { auth: true }
|
||||
|
||||
/**
|
||||
* 在主框架内显示
|
||||
*/
|
||||
@@ -25,7 +23,9 @@ const frameIn = [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'index',
|
||||
meta,
|
||||
meta: {
|
||||
auth: true
|
||||
},
|
||||
component: () => import('@/pages/index')
|
||||
},
|
||||
// 刷新页面 必须保留
|
||||
|
||||
@@ -63,11 +63,5 @@ export default {
|
||||
// 是否默认开启页面切换动画
|
||||
transition: {
|
||||
active: true
|
||||
},
|
||||
// 在读取持久化数据失败时默认用户信息
|
||||
user: {
|
||||
info: {
|
||||
name: 'Ghost'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
// 设置文件
|
||||
import setting from '@/setting.js'
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
// 用户信息
|
||||
info: setting.user.info
|
||||
info: {}
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user