diff --git a/components.d.ts b/components.d.ts index 595e59d..dc36e45 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,13 +8,12 @@ export {} declare module 'vue' { export interface GlobalComponents { AppIcon: typeof import('./src/components/AppIcon.vue')['default'] + Default: typeof import('./src/components/layouts/default.vue')['default'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElButton: typeof import('element-plus/es')['ElButton'] ElCard: typeof import('element-plus/es')['ElCard'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] - ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup'] ElCol: typeof import('element-plus/es')['ElCol'] - ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] @@ -22,23 +21,23 @@ declare module 'vue' { ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] + ElIconHide: typeof import('@element-plus/icons-vue')['Hide'] + ElIconView: typeof import('@element-plus/icons-vue')['View'] ElInput: typeof import('element-plus/es')['ElInput'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] - ElOption: typeof import('element-plus/es')['ElOption'] - ElPagination: typeof import('element-plus/es')['ElPagination'] ElProgress: typeof import('element-plus/es')['ElProgress'] - ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] - ElSelect: typeof import('element-plus/es')['ElSelect'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElTag: typeof import('element-plus/es')['ElTag'] - ElText: typeof import('element-plus/es')['ElText'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] Header: typeof import('./src/components/header.vue')['default'] + Icon: typeof import('./src/components/likebocai/Icon.vue')['default'] + IconInfo: typeof import('./src/components/likebocai/IconInfo.vue')['default'] + Input: typeof import('./src/components/likebocai/input.vue')['default'] OrgSelect: typeof import('./src/components/OrgSelect.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/src/components/layouts/default.vue b/src/components/layouts/default.vue new file mode 100644 index 0000000..b5da4f4 --- /dev/null +++ b/src/components/layouts/default.vue @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/src/components/layouts/header.vue b/src/components/layouts/header.vue new file mode 100644 index 0000000..db426f4 --- /dev/null +++ b/src/components/layouts/header.vue @@ -0,0 +1,52 @@ + + + + + \ No newline at end of file diff --git a/src/components/likebocai/Icon.vue b/src/components/likebocai/Icon.vue new file mode 100644 index 0000000..91152a4 --- /dev/null +++ b/src/components/likebocai/Icon.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/src/components/likebocai/IconInfo.vue b/src/components/likebocai/IconInfo.vue new file mode 100644 index 0000000..2f9fa7c --- /dev/null +++ b/src/components/likebocai/IconInfo.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/src/components/likebocai/image.png b/src/components/likebocai/image.png new file mode 100644 index 0000000..7342ba1 Binary files /dev/null and b/src/components/likebocai/image.png differ diff --git a/src/components/likebocai/input.vue b/src/components/likebocai/input.vue new file mode 100644 index 0000000..f0cb482 --- /dev/null +++ b/src/components/likebocai/input.vue @@ -0,0 +1,75 @@ + + + + + \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index bd26132..b83f8c2 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,52 +1,52 @@ -import {createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router'; +import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'; import Home from '../views/home.vue'; -import {useBasicStore} from "../store/basic"; - +import { useBasicStore } from "../store/basic"; +import LikebocaiDefault from '../components/layouts/default.vue' const serverRoutes: RouteRecordRaw[] = [ - { - path: '/dashboard', - name: 'dashboard', - meta: { - title: '系统首页', - }, - component: () => import(/* webpackChunkName: "dashboard" */ '../views/dashboard.vue'), + { + path: '/dashboard', + name: 'dashboard', + meta: { + title: '系统首页', }, - { - path: '/users', - name: 'users', - meta: { - title: '用户列表', - }, - component: () => import(/* webpackChunkName: "dashboard" */ '../views/user-list.vue'), - }, { - path: '/roles', - name: 'roles', - meta: { - title: '角色管理', - }, - component: () => import(/* webpackChunkName: "dashboard" */ '../views/role-list.vue'), - }, { - path: '/resources', - name: 'resources', - meta: { - title: '权限资源', - }, - component: () => import(/* webpackChunkName: "dashboard" */ '../views/resource-list.vue'), - },{ - path: '/torrent', - name: 'torrent', - meta: { - title: '种子', - }, - component: () => import(/* webpackChunkName: "dashboard" */ '../views/torrent.vue'), - },{ - path: '/upload', - name: 'upload', - meta : { - title: '发布', - }, - component: () => import(/* webpackChunkName: "dashboard" */'../views/upload-torrent.vue'), - } + component: () => import(/* webpackChunkName: "dashboard" */ '../views/dashboard.vue'), + }, + { + path: '/users', + name: 'users', + meta: { + title: '用户列表', + }, + component: () => import(/* webpackChunkName: "dashboard" */ '../views/user-list.vue'), + }, { + path: '/roles', + name: 'roles', + meta: { + title: '角色管理', + }, + component: () => import(/* webpackChunkName: "dashboard" */ '../views/role-list.vue'), + }, { + path: '/resources', + name: 'resources', + meta: { + title: '权限资源', + }, + component: () => import(/* webpackChunkName: "dashboard" */ '../views/resource-list.vue'), + }, { + path: '/torrent', + name: 'torrent', + meta: { + title: '种子', + }, + component: () => import(/* webpackChunkName: "dashboard" */ '../views/torrent.vue'), + }, { + path: '/upload', + name: 'upload', + meta: { + title: '发布', + }, + component: () => import(/* webpackChunkName: "dashboard" */'../views/upload-torrent.vue'), + } ]; const routes: RouteRecordRaw[] = [ @@ -114,8 +114,8 @@ const routes: RouteRecordRaw[] = [ meta: { title: "重置密码", }, - component: () => - import("../views/resetPassword.vue") + component: () => + import("../views/resetPassword.vue") }, { path: "/403", @@ -125,32 +125,60 @@ const routes: RouteRecordRaw[] = [ }, component: () => import(/* webpackChunkName: "403" */ "../views/403.vue"), }, + // registerLikebocai + { + path: "/likebocai", + name: "likebocai", + meta: { + title: "likebocai | 框架", + }, + component: LikebocaiDefault, + children: [ + { + path: "torrentList", + name: "torrentList", + meta: { + title: "种子列表", + }, + component: () => import(/* webpackChunkName: "torrentList" */ "../views/torrent-list.vue"), + } + ] + }, + // registerLikebocai + { + path: "/registerLikebocai", + name: "registerLikebocai", + meta: { + title: "likebocai | 注册", + }, + component: () => import(/* webpackChunkName: "registerLikebocai" */ "../views/registerLikebocai.vue"), + }, ]; const router = createRouter({ - history: createWebHashHistory(), - routes, -}); - -router.beforeEach(async (to, from, next) => { - document.title = `${to.meta.title} | Rocket PT`; - const token = localStorage.getItem('token'); - const basicStore = useBasicStore(); - if (!token && (to.path !== '/login' && to.path !== '/register') && to.path !== '/forgotPassword' && to.path !== '/resetPassword') { - next('/login'); - } /*else if (to.meta.permiss && !permiss.key.includes(to.meta.permiss)) { - // 如果没有权限,则进入403 - next('/403'); - }*/ else { - if (token) { - try { - await basicStore.fetchUserinfo(); - } catch(error) { - localStorage.removeItem('token'); - return; - } - } - next(); - } + history: createWebHashHistory(), + routes, }); +/*else if (to.meta.permiss && !permiss.key.includes(to.meta.permiss)) { + // 如果没有权限,则进入403 + next('/403'); + }*/ +// router.beforeEach(async (to, from, next) => { +// document.title = `${to.meta.title} | Rocket PT`; +// const token = localStorage.getItem('token'); +// const basicStore = useBasicStore(); +// if (!token && (to.path !== '/login' && to.path !== '/register') && to.path !== '/forgotPassword' && to.path !== '/resetPassword') { +// next('/login'); +// } else { +// if (token) { +// try { +// await basicStore.fetchUserinfo(); +// } catch(error) { +// localStorage.removeItem('token'); +// return; +// } +// } +// next(); +// } +// }); export default router; diff --git a/src/views/registerLikebocai.vue b/src/views/registerLikebocai.vue new file mode 100644 index 0000000..81f1b19 --- /dev/null +++ b/src/views/registerLikebocai.vue @@ -0,0 +1,172 @@ + + + + + \ No newline at end of file diff --git a/src/views/torrent-list.vue b/src/views/torrent-list.vue new file mode 100644 index 0000000..e23ecfb --- /dev/null +++ b/src/views/torrent-list.vue @@ -0,0 +1,202 @@ + + + + + \ No newline at end of file