Commit 7ab616ea authored by 张伯涛's avatar 张伯涛

1.退出登录接口注释

2.用户管理部门树默认展开
parent 0276c2d9
......@@ -154,13 +154,13 @@ export const useUserStore = defineStore({
* @description: logout
*/
async logout(goLogin = false) {
if (this.getToken) {
try {
await doLogout();
} catch {
console.log('注销Token失败');
}
}
// if (this.getToken) {
// try {
// await doLogout();
// } catch {
// console.log('注销Token失败');
// }
// }
this.setToken(undefined);
this.setSessionTimeout(false);
this.setUserInfo(null);
......
......@@ -2,7 +2,7 @@
<div class="m-4 mr-0 overflow-hidden bg-white">
<BasicTree
title="部门列表"
ref="basicTreeRef"
ref="treeRef"
toolbar
search
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
......@@ -15,19 +15,31 @@
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import {BasicTree, TreeItem} from '@/components/Tree';
import {nextTick, onMounted, ref, unref} from 'vue';
import {BasicTree, TreeActionType, TreeItem} from '@/components/Tree';
import { getDeptList } from '@/api/system/dept/dept';
import {Nullable} from "@vben/types";
defineOptions({ name: 'DeptTree' });
const emit = defineEmits(['select']);
const treeData = ref<TreeItem[]>([]);
const treeRef = ref<Nullable<TreeActionType>>(null);
function getTree() {
const tree = unref(treeRef);
if (!tree) {
throw new Error('tree is null!');
}
return tree;
}
async function fetch() {
async function fetch() {
const res = await getDeptList()
treeData.value = handleTree(res.data, 'businessId',undefined,undefined,undefined)
await nextTick(() => {
getTree().expandAll(true)
})
}
function handleTree(data, id, parentId, children, rootId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment