diff --git a/blossom-web/components.d.ts b/blossom-web/components.d.ts index fbbc0ce..07a07ed 100644 --- a/blossom-web/components.d.ts +++ b/blossom-web/components.d.ts @@ -11,13 +11,17 @@ declare module 'vue' { BLRow: typeof import('./src/components/BLRow.vue')['default'] BLTag: typeof import('./src/components/BLTag.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] + ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] + ElCalendar: typeof import('element-plus/es')['ElCalendar'] + ElDrawer: typeof import('element-plus/es')['ElDrawer'] ElInput: typeof import('element-plus/es')['ElInput'] - ElInputPassword: typeof import('element-plus/es')['ElInputPassword'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElPopover: typeof import('element-plus/es')['ElPopover'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] + ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] + ElSlider: typeof import('element-plus/es')['ElSlider'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] - ElTooltip: typeof import('element-plus/es')['ElTooltip'] NotFound: typeof import('./src/components/NotFound.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/blossom-web/declaration.d.ts b/blossom-web/declaration.d.ts index e69de29..0c2ae36 100644 --- a/blossom-web/declaration.d.ts +++ b/blossom-web/declaration.d.ts @@ -0,0 +1 @@ +declare module 'element-plus/dist/locale/zh-cn.mjs' diff --git a/blossom-web/index.html b/blossom-web/index.html index bde8bd6..9d86c6e 100644 --- a/blossom-web/index.html +++ b/blossom-web/index.html @@ -9,7 +9,6 @@ diff --git a/blossom-web/src/router/route-init.ts b/blossom-web/src/router/route-init.ts index 6786a3b..e3387c6 100644 --- a/blossom-web/src/router/route-init.ts +++ b/blossom-web/src/router/route-init.ts @@ -11,6 +11,8 @@ const Index = () => import('../views/Index.vue') const Home = () => import('../views/index/Home.vue') const Login = () => import('@/views/index/Login.vue') const Articles = () => import('@/views/article/Articles.vue') +const TodoIndex = () => import('@/views/todo/TodoIndex.vue') +const PlanIndex = () => import('@/views/plan/PlanIndex.vue') router.addRoute({ path: '/404', component: NotFound }) router.addRoute({ path: '/:pathMatch(.*)', redirect: '/404' }) @@ -23,6 +25,8 @@ router.addRoute({ children: [ { path: '/home', name: 'Home', component: Home, meta: { keepAlive: true } }, { path: '/login', name: 'Login', component: Login, meta: { keepAlive: true } }, - { path: '/articles', name: 'Articles', component: Articles, meta: { keepAlive: false } } + { path: '/articles', name: 'Articles', component: Articles, meta: { keepAlive: false } }, + { path: '/todo', name: 'TodoIndex', component: TodoIndex, meta: { keepAlive: false } }, + { path: '/plan', name: 'PlanIndex', component: PlanIndex, meta: { keepAlive: false } } ] }) diff --git a/blossom-web/src/stores/user.ts b/blossom-web/src/stores/user.ts index 7476c54..4d343d3 100644 --- a/blossom-web/src/stores/user.ts +++ b/blossom-web/src/stores/user.ts @@ -47,6 +47,14 @@ export const useUserStore = defineStore('userStore', { auth: Local.get(storeKey) || initAuth(), userinfo: Local.get(userinfoKey) || initUserinfo() }), + getters: { + isLogin: (state): boolean => { + if (!state.auth) { + return false + } + return state.auth.status === AuthStatus.Succ + } + }, actions: { // /** // * 根据用户名密码登录 diff --git a/blossom-web/src/views/article/Articles.vue b/blossom-web/src/views/article/Articles.vue index bb37ada..8a9da46 100644 --- a/blossom-web/src/views/article/Articles.vue +++ b/blossom-web/src/views/article/Articles.vue @@ -28,46 +28,60 @@