Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

退出登录取消菜单栏授权 #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//===========================================
//============= Editor ======================
//===========================================
"workbench.colorTheme": "Atom One Dark",
"workbench.colorTheme": "Default Dark+",
"editor.smoothScrolling": true,
"editor.cursorSmoothCaretAnimation": true,
"diffEditor.ignoreTrimWhitespace": false,
Expand Down
1 change: 1 addition & 0 deletions src/layouts/dashboard/header/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineComponent({
message.warn('此功能暂未开放')
} else if (key === 'logout') {
Cookies.remove('token')
store.commit('setAuthority', false)
push('/login')
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const store = createStore<GlobalData>({
}
},
mutations: {
setAuthority(state) {
state.authorized = true
setAuthority(state, flag) {
state.authorized = flag
},
setAccessRoutes(state, accessRoutes) {
state.accessRoutes = accessRoutes
Expand Down Expand Up @@ -84,7 +84,7 @@ const store = createStore<GlobalData>({
commit('setDict', dictRes.data)
/* OK */

commit('setAuthority')
commit('setAuthority', true)
commit('setAccessRoutes', data)
resolve()
})
Expand Down
12 changes: 12 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ const viteConfig: UserConfig = {
}
}
},
build: {
rollupOptions: {
external: ['vue', 'moment', 'ant-design-vue'],
output: {
paths: {
vue: 'https://cdn.jsdelivr.net/npm/vue@3.0.7/dist/vue.esm-browser.prod.js',
moment: 'https://cdn.jsdelivr.net/npm/moment@2.29.1/dist/moment.js',
'ant-design-vue': 'https://cdn.jsdelivr.net/npm/ant-design-vue@2.0.1/dist/antd.js'
}
}
}
},
server: {
port: 3399,
open: true
Expand Down