Merge branch 'develop' of github.com:Tencent/tdesign-vue-next-starter into main

This commit is contained in:
Uyarn 2022-11-18 11:30:59 +08:00
commit 7d744f6dad
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,7 @@ const InitUserInfo = {
export const useUserStore = defineStore('user', { export const useUserStore = defineStore('user', {
state: () => ({ state: () => ({
token: localStorage.getItem(TOKEN_NAME) || 'main_token', // 默认token不走权限 token: localStorage.getItem(TOKEN_NAME) || 'main_token', // 默认token不走权限
userInfo: InitUserInfo, userInfo: { ...InitUserInfo },
}), }),
getters: { getters: {
roles: (state) => { roles: (state) => {
@ -73,7 +73,7 @@ export const useUserStore = defineStore('user', {
async logout() { async logout() {
localStorage.removeItem(TOKEN_NAME); localStorage.removeItem(TOKEN_NAME);
this.token = ''; this.token = '';
this.userInfo = InitUserInfo; this.userInfo = { ...InitUserInfo };
}, },
async removeToken() { async removeToken() {
this.token = ''; this.token = '';

View File

@ -6,6 +6,10 @@
width: fit-content; width: fit-content;
} }
.t-layout__header {
height: auto;
}
.t-button + .t-button { .t-button + .t-button {
margin-left: @spacer; margin-left: @spacer;
} }