@kevairy/template 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +14 -0
- package/package.json +37 -0
- package/template/.env +22 -0
- package/template/.env.development +13 -0
- package/template/.env.production +10 -0
- package/template/.prettierignore +3 -0
- package/template/.prettierrc +20 -0
- package/template/.stylelintignore +9 -0
- package/template/.stylelintrc.cjs +84 -0
- package/template/LICENSE +21 -0
- package/template/README.md +22 -0
- package/template/_gitignore +19 -0
- package/template/eslint-auto-import.json +324 -0
- package/template/eslint.config.mjs +83 -0
- package/template/index.html +25 -0
- package/template/package.json +79 -0
- package/template/playwright.config.ts +25 -0
- package/template/public/favicon.ico +0 -0
- package/template/src/App.vue +39 -0
- package/template/src/adapters/auth/index.ts +9 -0
- package/template/src/adapters/auth/mock.ts +10 -0
- package/template/src/adapters/auth/types.ts +11 -0
- package/template/src/adapters/navigation/index.ts +13 -0
- package/template/src/adapters/navigation/types.ts +6 -0
- package/template/src/api/auth.ts +23 -0
- package/template/src/assets/images/avatar/avatar.webp +0 -0
- package/template/src/assets/images/avatar/avatar1.webp +0 -0
- package/template/src/assets/images/avatar/avatar10.webp +0 -0
- package/template/src/assets/images/avatar/avatar2.webp +0 -0
- package/template/src/assets/images/avatar/avatar3.webp +0 -0
- package/template/src/assets/images/avatar/avatar4.webp +0 -0
- package/template/src/assets/images/avatar/avatar5.webp +0 -0
- package/template/src/assets/images/avatar/avatar6.webp +0 -0
- package/template/src/assets/images/avatar/avatar7.webp +0 -0
- package/template/src/assets/images/avatar/avatar8.webp +0 -0
- package/template/src/assets/images/avatar/avatar9.webp +0 -0
- package/template/src/assets/images/ceremony/hb.png +0 -0
- package/template/src/assets/images/ceremony/sd.png +0 -0
- package/template/src/assets/images/ceremony/xc.png +0 -0
- package/template/src/assets/images/ceremony/yd.png +0 -0
- package/template/src/assets/images/common/logo.webp +0 -0
- package/template/src/assets/images/draw/draw1.png +0 -0
- package/template/src/assets/images/favicon.ico +0 -0
- package/template/src/assets/images/lock/bg_dark.webp +0 -0
- package/template/src/assets/images/lock/bg_light.webp +0 -0
- package/template/src/assets/images/login/kylin-hero-source.png +0 -0
- package/template/src/assets/images/login/lf_icon2.webp +0 -0
- package/template/src/assets/images/settings/menu_layouts/dual_column.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/horizontal.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/mixed.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/vertical.png +0 -0
- package/template/src/assets/images/settings/menu_styles/dark.png +0 -0
- package/template/src/assets/images/settings/menu_styles/design.png +0 -0
- package/template/src/assets/images/settings/menu_styles/light.png +0 -0
- package/template/src/assets/images/settings/theme_styles/dark.png +0 -0
- package/template/src/assets/images/settings/theme_styles/light.png +0 -0
- package/template/src/assets/images/settings/theme_styles/system.png +0 -0
- package/template/src/assets/images/svg/403.svg +1 -0
- package/template/src/assets/images/svg/404.svg +1 -0
- package/template/src/assets/images/svg/500.svg +5 -0
- package/template/src/assets/images/svg/login_icon.svg +1 -0
- package/template/src/assets/images/user/avatar.webp +0 -0
- package/template/src/assets/images/user/bg.webp +0 -0
- package/template/src/assets/styles/core/app.scss +227 -0
- package/template/src/assets/styles/core/dark.scss +93 -0
- package/template/src/assets/styles/core/el-dark.scss +2 -0
- package/template/src/assets/styles/core/el-light.scss +34 -0
- package/template/src/assets/styles/core/el-ui.scss +519 -0
- package/template/src/assets/styles/core/md.scss +1036 -0
- package/template/src/assets/styles/core/mixin.scss +157 -0
- package/template/src/assets/styles/core/reset.scss +41 -0
- package/template/src/assets/styles/core/router-transition.scss +104 -0
- package/template/src/assets/styles/core/tailwind.css +219 -0
- package/template/src/assets/styles/core/theme-animation.scss +63 -0
- package/template/src/assets/styles/core/theme-change.scss +11 -0
- package/template/src/assets/styles/custom/one-dark-pro.scss +98 -0
- package/template/src/assets/styles/index.scss +23 -0
- package/template/src/assets/svg/loading.ts +32 -0
- package/template/src/bootstrap/initializeApp.ts +30 -0
- package/template/src/components/core/banners/art-basic-banner/index.vue +343 -0
- package/template/src/components/core/banners/art-card-banner/index.vue +114 -0
- package/template/src/components/core/base/art-back-to-top/index.vue +40 -0
- package/template/src/components/core/base/art-logo/index.vue +34 -0
- package/template/src/components/core/base/art-svg-icon/index.vue +24 -0
- package/template/src/components/core/cards/art-bar-chart-card/index.vue +103 -0
- package/template/src/components/core/cards/art-data-list-card/index.vue +74 -0
- package/template/src/components/core/cards/art-donut-chart-card/index.vue +124 -0
- package/template/src/components/core/cards/art-image-card/index.vue +89 -0
- package/template/src/components/core/cards/art-line-chart-card/index.vue +126 -0
- package/template/src/components/core/cards/art-progress-card/index.vue +86 -0
- package/template/src/components/core/cards/art-stats-card/index.vue +67 -0
- package/template/src/components/core/cards/art-timeline-list-card/index.vue +69 -0
- package/template/src/components/core/charts/art-bar-chart/index.vue +203 -0
- package/template/src/components/core/charts/art-dual-bar-compare-chart/index.vue +195 -0
- package/template/src/components/core/charts/art-h-bar-chart/index.vue +208 -0
- package/template/src/components/core/charts/art-k-line-chart/index.vue +152 -0
- package/template/src/components/core/charts/art-line-chart/index.vue +371 -0
- package/template/src/components/core/charts/art-radar-chart/index.vue +105 -0
- package/template/src/components/core/charts/art-ring-chart/index.vue +133 -0
- package/template/src/components/core/charts/art-scatter-chart/index.vue +115 -0
- package/template/src/components/core/feedback/art-page-loading/index.vue +281 -0
- package/template/src/components/core/forms/art-button-more/index.vue +71 -0
- package/template/src/components/core/forms/art-button-table/index.vue +59 -0
- package/template/src/components/core/forms/art-drag-verify/index.vue +430 -0
- package/template/src/components/core/forms/art-excel-export/index.vue +390 -0
- package/template/src/components/core/forms/art-excel-import/index.vue +62 -0
- package/template/src/components/core/forms/art-form/index.vue +507 -0
- package/template/src/components/core/forms/art-wang-editor/index.vue +261 -0
- package/template/src/components/core/forms/art-wang-editor/style.scss +273 -0
- package/template/src/components/core/layouts/art-breadcrumb/index.vue +142 -0
- package/template/src/components/core/layouts/art-chat-window/index.vue +262 -0
- package/template/src/components/core/layouts/art-fast-enter/index.vue +113 -0
- package/template/src/components/core/layouts/art-fireworks-effect/index.vue +633 -0
- package/template/src/components/core/layouts/art-global-component/index.vue +14 -0
- package/template/src/components/core/layouts/art-global-search/index.vue +431 -0
- package/template/src/components/core/layouts/art-header-bar/index.vue +485 -0
- package/template/src/components/core/layouts/art-header-bar/widget/ArtUserMenu.vue +118 -0
- package/template/src/components/core/layouts/art-menus/art-horizontal-menu/index.vue +110 -0
- package/template/src/components/core/layouts/art-menus/art-horizontal-menu/widget/HorizontalSubmenu.vue +106 -0
- package/template/src/components/core/layouts/art-menus/art-mixed-menu/index.vue +279 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/index.vue +354 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/style.scss +251 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/theme.scss +258 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue +190 -0
- package/template/src/components/core/layouts/art-notification/index.vue +456 -0
- package/template/src/components/core/layouts/art-page-content/index.vue +137 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsConfig.ts +248 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsHandlers.ts +167 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsPanel.ts +233 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsState.ts +37 -0
- package/template/src/components/core/layouts/art-settings-panel/index.vue +72 -0
- package/template/src/components/core/layouts/art-settings-panel/style.scss +92 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/BasicSettings.vue +77 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/BoxStyleSettings.vue +38 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ColorSettings.vue +35 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ContainerSettings.vue +33 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/MenuLayoutSettings.vue +31 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/MenuStyleSettings.vue +44 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SectionTitle.vue +17 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingActions.vue +236 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingDrawer.vue +51 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingHeader.vue +18 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingItem.vue +101 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ThemeSettings.vue +28 -0
- package/template/src/components/core/layouts/art-work-tab/index.vue +584 -0
- package/template/src/components/core/media/art-cutter-img/index.vue +350 -0
- package/template/src/components/core/media/art-video-player/index.vue +111 -0
- package/template/src/components/core/others/art-menu-right/index.vue +415 -0
- package/template/src/components/core/others/art-watermark/index.vue +64 -0
- package/template/src/components/core/text-effect/art-count-to/index.vue +310 -0
- package/template/src/components/core/text-effect/art-festival-text-scroll/index.vue +32 -0
- package/template/src/components/core/text-effect/art-text-scroll/index.vue +285 -0
- package/template/src/components/core/theme/theme-svg/index.vue +100 -0
- package/template/src/components/core/views/exception/ArtException.vue +55 -0
- package/template/src/components/core/views/login/AuthTopBar.vue +149 -0
- package/template/src/components/core/views/login/LoginLeftView.vue +602 -0
- package/template/src/components/core/views/result/ArtResultPage.vue +43 -0
- package/template/src/components/core/widget/art-icon-button/index.vue +23 -0
- package/template/src/config/assets/images.ts +61 -0
- package/template/src/config/index.ts +170 -0
- package/template/src/config/modules/component.ts +98 -0
- package/template/src/config/modules/fastEnter.ts +16 -0
- package/template/src/config/modules/festival.ts +51 -0
- package/template/src/config/modules/headerBar.ts +64 -0
- package/template/src/config/setting.ts +109 -0
- package/template/src/directives/core/auth.ts +66 -0
- package/template/src/directives/core/highlight-loader.ts +37 -0
- package/template/src/directives/core/highlight.ts +253 -0
- package/template/src/directives/core/ripple.ts +116 -0
- package/template/src/directives/core/roles.ts +87 -0
- package/template/src/directives/index.ts +14 -0
- package/template/src/enums/appEnum.ts +81 -0
- package/template/src/enums/formEnum.ts +17 -0
- package/template/src/env.d.ts +32 -0
- package/template/src/hooks/core/useAppMode.ts +45 -0
- package/template/src/hooks/core/useAuth.ts +74 -0
- package/template/src/hooks/core/useCeremony.ts +184 -0
- package/template/src/hooks/core/useChart.ts +745 -0
- package/template/src/hooks/core/useCommon.ts +87 -0
- package/template/src/hooks/core/useFastEnter.ts +55 -0
- package/template/src/hooks/core/useHeaderBar.ts +201 -0
- package/template/src/hooks/core/useLayoutHeight.ts +148 -0
- package/template/src/hooks/core/useTableColumns.ts +313 -0
- package/template/src/hooks/core/useTheme.ts +174 -0
- package/template/src/hooks/index.ts +29 -0
- package/template/src/locales/index.ts +123 -0
- package/template/src/locales/langs/en.json +283 -0
- package/template/src/locales/langs/zh.json +283 -0
- package/template/src/main.ts +29 -0
- package/template/src/mock/auth.ts +46 -0
- package/template/src/plugins/echarts.ts +76 -0
- package/template/src/plugins/index.ts +6 -0
- package/template/src/router/core/ComponentLoader.ts +82 -0
- package/template/src/router/core/IframeRouteManager.ts +78 -0
- package/template/src/router/core/MenuProcessor.ts +280 -0
- package/template/src/router/core/RoutePermissionValidator.ts +161 -0
- package/template/src/router/core/RouteRegistry.ts +90 -0
- package/template/src/router/core/RouteTransformer.ts +132 -0
- package/template/src/router/core/RouteValidator.ts +187 -0
- package/template/src/router/core/index.ts +14 -0
- package/template/src/router/guards/afterEach.ts +34 -0
- package/template/src/router/guards/beforeEach.ts +442 -0
- package/template/src/router/index.ts +24 -0
- package/template/src/router/modules/dashboard.ts +23 -0
- package/template/src/router/modules/examples.ts +109 -0
- package/template/src/router/modules/exception.ts +46 -0
- package/template/src/router/modules/index.ts +12 -0
- package/template/src/router/modules/result.ts +32 -0
- package/template/src/router/routes/asyncRoutes.ts +9 -0
- package/template/src/router/routes/staticRoutes.ts +60 -0
- package/template/src/router/routesAlias.ts +8 -0
- package/template/src/services/auth.ts +15 -0
- package/template/src/store/index.ts +52 -0
- package/template/src/store/modules/menu.ts +109 -0
- package/template/src/store/modules/setting.ts +450 -0
- package/template/src/store/modules/user.ts +218 -0
- package/template/src/store/modules/worktab.ts +568 -0
- package/template/src/types/api/api.d.ts +86 -0
- package/template/src/types/common/index.ts +95 -0
- package/template/src/types/common/response.ts +32 -0
- package/template/src/types/component/chart.ts +324 -0
- package/template/src/types/component/index.ts +86 -0
- package/template/src/types/config/index.ts +253 -0
- package/template/src/types/directive/directive.d.ts +15 -0
- package/template/src/types/import/auto-imports.d.ts +319 -0
- package/template/src/types/import/components.d.ts +126 -0
- package/template/src/types/index.ts +22 -0
- package/template/src/types/router/index.ts +80 -0
- package/template/src/types/store/index.ts +157 -0
- package/template/src/utils/form/index.ts +9 -0
- package/template/src/utils/form/validator.ts +316 -0
- package/template/src/utils/http/contract.ts +39 -0
- package/template/src/utils/http/error.ts +182 -0
- package/template/src/utils/http/index.ts +226 -0
- package/template/src/utils/http/status.ts +18 -0
- package/template/src/utils/index.ts +31 -0
- package/template/src/utils/navigation/index.ts +10 -0
- package/template/src/utils/navigation/jump.ts +68 -0
- package/template/src/utils/navigation/route.ts +85 -0
- package/template/src/utils/navigation/worktab.ts +67 -0
- package/template/src/utils/router.ts +63 -0
- package/template/src/utils/socket/index.ts +423 -0
- package/template/src/utils/storage/index.ts +7 -0
- package/template/src/utils/storage/storage-config.ts +127 -0
- package/template/src/utils/storage/storage-key-manager.ts +97 -0
- package/template/src/utils/storage/storage.ts +250 -0
- package/template/src/utils/sys/console.ts +9 -0
- package/template/src/utils/sys/error-handle.ts +143 -0
- package/template/src/utils/sys/index.ts +2 -0
- package/template/src/utils/sys/mittBus.ts +61 -0
- package/template/src/utils/ui/animation.ts +80 -0
- package/template/src/utils/ui/colors.ts +273 -0
- package/template/src/utils/ui/emojo.ts +24 -0
- package/template/src/utils/ui/iconify-loader.ts +31 -0
- package/template/src/utils/ui/index.ts +11 -0
- package/template/src/utils/ui/loading.ts +158 -0
- package/template/src/utils/ui/tabs.ts +60 -0
- package/template/src/views/auth/forget-password/index.vue +62 -0
- package/template/src/views/auth/login/index.vue +166 -0
- package/template/src/views/auth/login/style.css +38 -0
- package/template/src/views/auth/register/index.vue +240 -0
- package/template/src/views/dashboard/console/index.vue +173 -0
- package/template/src/views/examples/analytics/index.vue +389 -0
- package/template/src/views/examples/complex-form/index.vue +395 -0
- package/template/src/views/examples/crud-workspace/index.vue +412 -0
- package/template/src/views/examples/navigation/detail/index.vue +151 -0
- package/template/src/views/examples/navigation/state/index.vue +226 -0
- package/template/src/views/examples/overview/index.vue +309 -0
- package/template/src/views/examples/permissions/index.vue +303 -0
- package/template/src/views/examples/search-table/index.vue +182 -0
- package/template/src/views/examples/search-table/search.config.ts +81 -0
- package/template/src/views/examples/search-table/service.ts +116 -0
- package/template/src/views/examples/search-table/table.config.ts +37 -0
- package/template/src/views/exception/403/index.vue +16 -0
- package/template/src/views/exception/404/index.vue +16 -0
- package/template/src/views/exception/500/index.vue +16 -0
- package/template/src/views/index/index.vue +29 -0
- package/template/src/views/index/style.scss +93 -0
- package/template/src/views/outside/Iframe.vue +42 -0
- package/template/src/views/result/fail/index.vue +28 -0
- package/template/src/views/result/success/index.vue +21 -0
- package/template/tests/e2e/auth.spec.ts +14 -0
- package/template/tests/e2e/search-table.spec.ts +154 -0
- package/template/tests/unit/adapters/auth.spec.ts +38 -0
- package/template/tests/unit/config/app-config.spec.ts +17 -0
- package/template/tests/unit/directives/highlight.spec.ts +20 -0
- package/template/tests/unit/http/contract.spec.ts +47 -0
- package/template/tests/unit/mock/search-table.spec.ts +62 -0
- package/template/tests/unit/router/examples.spec.ts +52 -0
- package/template/tsconfig.json +28 -0
- package/template/vite.config.ts +181 -0
- package/template/vitest.config.ts +27 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
{
|
|
2
|
+
"httpMsg": {
|
|
3
|
+
"unauthorized": "Unauthorized access, please login again",
|
|
4
|
+
"forbidden": "Access to this resource is forbidden",
|
|
5
|
+
"notFound": "The requested resource does not exist",
|
|
6
|
+
"methodNotAllowed": "Request method not allowed",
|
|
7
|
+
"requestTimeout": "Request timeout, please try again later",
|
|
8
|
+
"internalServerError": "Internal server error, please try again later",
|
|
9
|
+
"badGateway": "Bad gateway error, please try again later",
|
|
10
|
+
"serviceUnavailable": "Service temporarily unavailable, please try again later",
|
|
11
|
+
"gatewayTimeout": "Gateway timeout, please try again later",
|
|
12
|
+
"requestCancelled": "Request cancelled",
|
|
13
|
+
"networkError": "Network connection error, please check your connection",
|
|
14
|
+
"requestFailed": "Request failed",
|
|
15
|
+
"requestConfigError": "Request configuration error"
|
|
16
|
+
},
|
|
17
|
+
"topBar": {
|
|
18
|
+
"search": {
|
|
19
|
+
"title": "Search"
|
|
20
|
+
},
|
|
21
|
+
"user": {
|
|
22
|
+
"userCenter": "User center",
|
|
23
|
+
"docs": "Document",
|
|
24
|
+
"github": "Github",
|
|
25
|
+
"logout": "Log out"
|
|
26
|
+
},
|
|
27
|
+
"guide": {
|
|
28
|
+
"title": "Click here to view",
|
|
29
|
+
"theme": "Theme style",
|
|
30
|
+
"menu": "Open top menu",
|
|
31
|
+
"description": "More configurations"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"common": {
|
|
35
|
+
"tips": "Prompt",
|
|
36
|
+
"cancel": "Cancel",
|
|
37
|
+
"confirm": "Confirm",
|
|
38
|
+
"logOutTips": "Do you want to log out?"
|
|
39
|
+
},
|
|
40
|
+
"search": {
|
|
41
|
+
"placeholder": "Search page",
|
|
42
|
+
"historyTitle": "Search history",
|
|
43
|
+
"switchKeydown": "Navigate",
|
|
44
|
+
"selectKeydown": "Select",
|
|
45
|
+
"exitKeydown": "Close"
|
|
46
|
+
},
|
|
47
|
+
"setting": {
|
|
48
|
+
"menuType": {
|
|
49
|
+
"title": "Menu Layout",
|
|
50
|
+
"list": ["Vertical", "Horizontal", "Mixed", "Dual"]
|
|
51
|
+
},
|
|
52
|
+
"theme": {
|
|
53
|
+
"title": "Theme Style",
|
|
54
|
+
"list": ["Light", "Dark", "System"]
|
|
55
|
+
},
|
|
56
|
+
"menu": {
|
|
57
|
+
"title": "Menu Style"
|
|
58
|
+
},
|
|
59
|
+
"color": {
|
|
60
|
+
"title": "Theme Color"
|
|
61
|
+
},
|
|
62
|
+
"box": {
|
|
63
|
+
"title": "Box Style",
|
|
64
|
+
"list": ["Border", "Shadow"]
|
|
65
|
+
},
|
|
66
|
+
"container": {
|
|
67
|
+
"title": "Container Width",
|
|
68
|
+
"list": ["Full", "Boxed"]
|
|
69
|
+
},
|
|
70
|
+
"basics": {
|
|
71
|
+
"title": "Basic Config",
|
|
72
|
+
"list": {
|
|
73
|
+
"multiTab": "Show work tab",
|
|
74
|
+
"accordion": "Sidebar opens accordion",
|
|
75
|
+
"collapseSidebar": "Show sidebar button",
|
|
76
|
+
"reloadPage": "Show reload page button",
|
|
77
|
+
"fastEnter": "Show fast enter",
|
|
78
|
+
"breadcrumb": "Show crumb navigation",
|
|
79
|
+
"language": "Show multilingual selection",
|
|
80
|
+
"progressBar": "Show top progress bar",
|
|
81
|
+
"weakMode": "Color Weakness Mode",
|
|
82
|
+
"watermark": "Global watermark",
|
|
83
|
+
"menuWidth": "Menu width",
|
|
84
|
+
"tabStyle": "Tab style",
|
|
85
|
+
"pageTransition": "Page animation",
|
|
86
|
+
"borderRadius": "Custom radius"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"tabStyle": {
|
|
90
|
+
"default": "Default",
|
|
91
|
+
"card": "Card",
|
|
92
|
+
"google": "Chrome"
|
|
93
|
+
},
|
|
94
|
+
"transition": {
|
|
95
|
+
"list": {
|
|
96
|
+
"none": "None",
|
|
97
|
+
"fade": "Fade",
|
|
98
|
+
"slideLeft": "Slide Left",
|
|
99
|
+
"slideBottom": "Slide Bottom",
|
|
100
|
+
"slideTop": "Slide Top"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"actions": {
|
|
104
|
+
"resetConfig": "Reset Config",
|
|
105
|
+
"copyConfig": "Copy Config",
|
|
106
|
+
"copySuccess": "Configuration copied to clipboard, paste it into src/config/setting.ts file",
|
|
107
|
+
"copyFailed": "Copy failed, please try again",
|
|
108
|
+
"resetFailed": "Reset failed, please refresh the page and try again"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"notice": {
|
|
112
|
+
"title": "Notice",
|
|
113
|
+
"btnRead": "Mark as read",
|
|
114
|
+
"bar": ["Notice", "Message", "Todo"],
|
|
115
|
+
"text": ["No"],
|
|
116
|
+
"viewAll": "View all"
|
|
117
|
+
},
|
|
118
|
+
"worktab": {
|
|
119
|
+
"btn": {
|
|
120
|
+
"refresh": "Refresh",
|
|
121
|
+
"fixed": "Fixed",
|
|
122
|
+
"unfixed": "Unfixed",
|
|
123
|
+
"closeLeft": "Close left",
|
|
124
|
+
"closeRight": "Close right",
|
|
125
|
+
"closeOther": "Close other",
|
|
126
|
+
"closeAll": "Close all"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"login": {
|
|
130
|
+
"leftView": {
|
|
131
|
+
"title": "Modern admin template",
|
|
132
|
+
"subTitle": "Build consistent and reliable admin applications with Vue 3, TypeScript, and Element Plus"
|
|
133
|
+
},
|
|
134
|
+
"title": "Welcome back",
|
|
135
|
+
"subTitle": "Please enter your account and password to login",
|
|
136
|
+
"roles": {
|
|
137
|
+
"super": "Super Admin",
|
|
138
|
+
"admin": "Admin",
|
|
139
|
+
"user": "User"
|
|
140
|
+
},
|
|
141
|
+
"placeholder": {
|
|
142
|
+
"username": "Please enter your account",
|
|
143
|
+
"password": "Please enter your password"
|
|
144
|
+
},
|
|
145
|
+
"mockMode": "Template mock mode: no real authentication service is called",
|
|
146
|
+
"mockSecurityNote": "Demo account: admin / 123456. Replace the auth adapter in a business project",
|
|
147
|
+
"mockBtnText": "Enter system (Mock)",
|
|
148
|
+
"invalidCredentials": "Incorrect username or password",
|
|
149
|
+
"unexpectedError": "Login failed. Please try again later",
|
|
150
|
+
"rememberPwd": "Remember password",
|
|
151
|
+
"forgetPwd": "Forgot password",
|
|
152
|
+
"noAccount": "No account yet?",
|
|
153
|
+
"register": "Register",
|
|
154
|
+
"success": {
|
|
155
|
+
"title": "Login successful",
|
|
156
|
+
"message": "Welcome back"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"forgetPassword": {
|
|
160
|
+
"title": "Forgot password?",
|
|
161
|
+
"subTitle": "Enter your email to reset your password",
|
|
162
|
+
"placeholder": "Please enter your email",
|
|
163
|
+
"submitBtnText": "Submit",
|
|
164
|
+
"backBtnText": "Back"
|
|
165
|
+
},
|
|
166
|
+
"register": {
|
|
167
|
+
"title": "Create account",
|
|
168
|
+
"subTitle": "Welcome to join us, please fill in the following information to complete the registration",
|
|
169
|
+
"placeholder": {
|
|
170
|
+
"username": "Please enter your account",
|
|
171
|
+
"password": "Please enter your password",
|
|
172
|
+
"confirmPassword": "Please enter your password again"
|
|
173
|
+
},
|
|
174
|
+
"rule": {
|
|
175
|
+
"confirmPasswordRequired": "Please enter your password again",
|
|
176
|
+
"passwordMismatch": "The two passwords are inconsistent!",
|
|
177
|
+
"usernameLength": "The length is 3 to 20 characters",
|
|
178
|
+
"passwordLength": "The password length cannot be less than 6 digits",
|
|
179
|
+
"agreementRequired": "Please agree to the privacy policy"
|
|
180
|
+
},
|
|
181
|
+
"agreeText": "I agree",
|
|
182
|
+
"privacyPolicy": "Privacy policy",
|
|
183
|
+
"submitBtnText": "Register",
|
|
184
|
+
"hasAccount": "Already have an account?",
|
|
185
|
+
"toLogin": "To login"
|
|
186
|
+
},
|
|
187
|
+
"greeting": {
|
|
188
|
+
"dawn": "Good morning!",
|
|
189
|
+
"morning": "Good morning!",
|
|
190
|
+
"afternoon": "Good afternoon!",
|
|
191
|
+
"evening": "Good evening!"
|
|
192
|
+
},
|
|
193
|
+
"exceptionPage": {
|
|
194
|
+
"403": "Sorry, you do not have permission to access this page",
|
|
195
|
+
"404": "Sorry, the page you are trying to access does not exist",
|
|
196
|
+
"500": "Sorry, there was an error on the server",
|
|
197
|
+
"gohome": "Go Home"
|
|
198
|
+
},
|
|
199
|
+
"menus": {
|
|
200
|
+
"login": {
|
|
201
|
+
"title": "Login"
|
|
202
|
+
},
|
|
203
|
+
"register": {
|
|
204
|
+
"title": "Register"
|
|
205
|
+
},
|
|
206
|
+
"forgetPassword": {
|
|
207
|
+
"title": "Forget Password"
|
|
208
|
+
},
|
|
209
|
+
"outside": {
|
|
210
|
+
"title": "Outside"
|
|
211
|
+
},
|
|
212
|
+
"dashboard": {
|
|
213
|
+
"title": "Dashboard",
|
|
214
|
+
"console": "Template Overview"
|
|
215
|
+
},
|
|
216
|
+
"examples": {
|
|
217
|
+
"title": "Template Examples",
|
|
218
|
+
"overview": "Routing Overview",
|
|
219
|
+
"searchTable": "Search Table",
|
|
220
|
+
"crudWorkspace": "CRUD Workspace",
|
|
221
|
+
"analytics": "Analytics Dashboard",
|
|
222
|
+
"complexForm": "Complex Form",
|
|
223
|
+
"permissions": "Permission Playground",
|
|
224
|
+
"navigation": {
|
|
225
|
+
"title": "Navigation & Cache",
|
|
226
|
+
"state": "Page State",
|
|
227
|
+
"detail": "Navigation Detail"
|
|
228
|
+
},
|
|
229
|
+
"result": {
|
|
230
|
+
"title": "Result Pages",
|
|
231
|
+
"success": "Success",
|
|
232
|
+
"fail": "Failure"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"result": {
|
|
236
|
+
"title": "Result Page",
|
|
237
|
+
"success": "Success",
|
|
238
|
+
"fail": "Fail"
|
|
239
|
+
},
|
|
240
|
+
"exception": {
|
|
241
|
+
"title": "Exception",
|
|
242
|
+
"forbidden": "403",
|
|
243
|
+
"notFound": "404",
|
|
244
|
+
"serverError": "500"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"table": {
|
|
248
|
+
"toolbar": {
|
|
249
|
+
"toggleSearch": "Show or hide search filters",
|
|
250
|
+
"refresh": "Refresh table",
|
|
251
|
+
"density": "Change table density",
|
|
252
|
+
"fullscreen": "Toggle table fullscreen",
|
|
253
|
+
"columns": "Configure visible columns",
|
|
254
|
+
"settings": "Configure table appearance"
|
|
255
|
+
},
|
|
256
|
+
"form": {
|
|
257
|
+
"reset": "Reset",
|
|
258
|
+
"submit": "Submit"
|
|
259
|
+
},
|
|
260
|
+
"searchBar": {
|
|
261
|
+
"reset": "Reset",
|
|
262
|
+
"search": "Search",
|
|
263
|
+
"expand": "Expand",
|
|
264
|
+
"collapse": "Collapse",
|
|
265
|
+
"searchInputPlaceholder": "Please enter",
|
|
266
|
+
"searchSelectPlaceholder": "Please select"
|
|
267
|
+
},
|
|
268
|
+
"selection": "Select",
|
|
269
|
+
"sizeOptions": {
|
|
270
|
+
"small": "Compact",
|
|
271
|
+
"default": "Default",
|
|
272
|
+
"large": "Loose"
|
|
273
|
+
},
|
|
274
|
+
"column": {
|
|
275
|
+
"selection": "Select",
|
|
276
|
+
"expand": "Expand",
|
|
277
|
+
"index": "Index"
|
|
278
|
+
},
|
|
279
|
+
"zebra": "Zebra",
|
|
280
|
+
"border": "Border",
|
|
281
|
+
"headerBackground": "Header BG"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
{
|
|
2
|
+
"httpMsg": {
|
|
3
|
+
"unauthorized": "未授权访问,请重新登录",
|
|
4
|
+
"forbidden": "禁止访问该资源",
|
|
5
|
+
"notFound": "请求的资源不存在",
|
|
6
|
+
"methodNotAllowed": "请求方法不允许",
|
|
7
|
+
"requestTimeout": "请求超时,请稍后重试",
|
|
8
|
+
"internalServerError": "服务器内部错误,请稍后重试",
|
|
9
|
+
"badGateway": "网关错误,请稍后重试",
|
|
10
|
+
"serviceUnavailable": "服务暂时不可用,请稍后重试",
|
|
11
|
+
"gatewayTimeout": "网关超时,请稍后重试",
|
|
12
|
+
"requestCancelled": "请求已取消",
|
|
13
|
+
"networkError": "网络连接异常,请检查网络连接",
|
|
14
|
+
"requestFailed": "请求失败",
|
|
15
|
+
"requestConfigError": "请求配置错误"
|
|
16
|
+
},
|
|
17
|
+
"topBar": {
|
|
18
|
+
"search": {
|
|
19
|
+
"title": "搜索"
|
|
20
|
+
},
|
|
21
|
+
"user": {
|
|
22
|
+
"userCenter": "个人中心",
|
|
23
|
+
"docs": "使用文档",
|
|
24
|
+
"github": "Github",
|
|
25
|
+
"logout": "退出登录"
|
|
26
|
+
},
|
|
27
|
+
"guide": {
|
|
28
|
+
"title": "点击这里查看",
|
|
29
|
+
"theme": "主题风格",
|
|
30
|
+
"menu": "开启顶栏菜单",
|
|
31
|
+
"description": "等更多配置"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"common": {
|
|
35
|
+
"tips": "提示",
|
|
36
|
+
"cancel": "取消",
|
|
37
|
+
"confirm": "确定",
|
|
38
|
+
"logOutTips": "您是否要退出登录?"
|
|
39
|
+
},
|
|
40
|
+
"search": {
|
|
41
|
+
"placeholder": "搜索页面",
|
|
42
|
+
"historyTitle": "搜索历史",
|
|
43
|
+
"switchKeydown": "切换",
|
|
44
|
+
"selectKeydown": "选择",
|
|
45
|
+
"exitKeydown": "关闭"
|
|
46
|
+
},
|
|
47
|
+
"setting": {
|
|
48
|
+
"menuType": {
|
|
49
|
+
"title": "菜单布局",
|
|
50
|
+
"list": ["垂直", "水平", "混合", "双列"]
|
|
51
|
+
},
|
|
52
|
+
"theme": {
|
|
53
|
+
"title": "主题风格",
|
|
54
|
+
"list": ["浅色", "深色", "系统"]
|
|
55
|
+
},
|
|
56
|
+
"menu": {
|
|
57
|
+
"title": "菜单风格"
|
|
58
|
+
},
|
|
59
|
+
"color": {
|
|
60
|
+
"title": "系统主题色"
|
|
61
|
+
},
|
|
62
|
+
"box": {
|
|
63
|
+
"title": "盒子样式",
|
|
64
|
+
"list": ["边框", "阴影"]
|
|
65
|
+
},
|
|
66
|
+
"container": {
|
|
67
|
+
"title": "容器宽度",
|
|
68
|
+
"list": ["铺满", "定宽"]
|
|
69
|
+
},
|
|
70
|
+
"basics": {
|
|
71
|
+
"title": "基础配置",
|
|
72
|
+
"list": {
|
|
73
|
+
"multiTab": "开启多标签栏",
|
|
74
|
+
"accordion": "侧边栏开启手风琴模式",
|
|
75
|
+
"collapseSidebar": "显示折叠侧边栏按钮",
|
|
76
|
+
"fastEnter": "显示快速入口",
|
|
77
|
+
"reloadPage": "显示重载页面按钮",
|
|
78
|
+
"breadcrumb": "显示全局面包屑导航",
|
|
79
|
+
"language": "显示多语言选择",
|
|
80
|
+
"progressBar": "显示顶部进度条",
|
|
81
|
+
"weakMode": "色弱模式",
|
|
82
|
+
"watermark": "全局水印",
|
|
83
|
+
"menuWidth": "菜单宽度",
|
|
84
|
+
"tabStyle": "标签页风格",
|
|
85
|
+
"pageTransition": "页面切换动画",
|
|
86
|
+
"borderRadius": "自定义圆角"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"tabStyle": {
|
|
90
|
+
"default": "默认",
|
|
91
|
+
"card": "卡片",
|
|
92
|
+
"google": "谷歌"
|
|
93
|
+
},
|
|
94
|
+
"transition": {
|
|
95
|
+
"list": {
|
|
96
|
+
"none": "无动画",
|
|
97
|
+
"fade": "淡入淡出",
|
|
98
|
+
"slideLeft": "左侧滑入",
|
|
99
|
+
"slideBottom": "下方滑入",
|
|
100
|
+
"slideTop": "上方滑入"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"actions": {
|
|
104
|
+
"resetConfig": "重置配置",
|
|
105
|
+
"copyConfig": "复制配置",
|
|
106
|
+
"copySuccess": "配置已复制到剪贴板,可粘贴到 src/config/setting.ts 文件中",
|
|
107
|
+
"copyFailed": "复制失败,请重试",
|
|
108
|
+
"resetFailed": "重置失败,请刷新页面后重试"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"notice": {
|
|
112
|
+
"title": "通知",
|
|
113
|
+
"btnRead": "标为已读",
|
|
114
|
+
"bar": ["通知", "消息", "代办"],
|
|
115
|
+
"text": ["暂无"],
|
|
116
|
+
"viewAll": "查看全部"
|
|
117
|
+
},
|
|
118
|
+
"worktab": {
|
|
119
|
+
"btn": {
|
|
120
|
+
"refresh": "刷新",
|
|
121
|
+
"fixed": "固定",
|
|
122
|
+
"unfixed": "取消固定",
|
|
123
|
+
"closeLeft": "关闭左侧",
|
|
124
|
+
"closeRight": "关闭右侧",
|
|
125
|
+
"closeOther": "关闭其他",
|
|
126
|
+
"closeAll": "关闭全部"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"login": {
|
|
130
|
+
"leftView": {
|
|
131
|
+
"title": "现代管理后台模板",
|
|
132
|
+
"subTitle": "基于 Vue 3、TypeScript 与 Element Plus,快速构建一致、可靠的管理应用"
|
|
133
|
+
},
|
|
134
|
+
"title": "欢迎回来",
|
|
135
|
+
"subTitle": "输入您的账号和密码登录",
|
|
136
|
+
"roles": {
|
|
137
|
+
"super": "超级管理员",
|
|
138
|
+
"admin": "管理员",
|
|
139
|
+
"user": "普通用户"
|
|
140
|
+
},
|
|
141
|
+
"placeholder": {
|
|
142
|
+
"username": "请输入账号",
|
|
143
|
+
"password": "请输入密码"
|
|
144
|
+
},
|
|
145
|
+
"mockMode": "模板 Mock 模式:当前不会请求真实认证服务",
|
|
146
|
+
"mockSecurityNote": "演示账号 admin,密码 123456;认证适配层可在业务项目中替换",
|
|
147
|
+
"mockBtnText": "进入系统(Mock)",
|
|
148
|
+
"invalidCredentials": "账号或密码错误",
|
|
149
|
+
"unexpectedError": "登录失败,请稍后重试",
|
|
150
|
+
"rememberPwd": "记住密码",
|
|
151
|
+
"forgetPwd": "忘记密码",
|
|
152
|
+
"noAccount": "还没有账号?",
|
|
153
|
+
"register": "注册",
|
|
154
|
+
"success": {
|
|
155
|
+
"title": "登录成功",
|
|
156
|
+
"message": "欢迎回来"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"forgetPassword": {
|
|
160
|
+
"title": "忘记密码?",
|
|
161
|
+
"subTitle": "输入您的电子邮件来重置您的密码",
|
|
162
|
+
"placeholder": "请输入您的电子邮件",
|
|
163
|
+
"submitBtnText": "提交",
|
|
164
|
+
"backBtnText": "返回"
|
|
165
|
+
},
|
|
166
|
+
"register": {
|
|
167
|
+
"title": "创建账号",
|
|
168
|
+
"subTitle": "欢迎加入我们,请填写以下信息完成注册",
|
|
169
|
+
"placeholder": {
|
|
170
|
+
"username": "请输入账号",
|
|
171
|
+
"password": "请输入密码",
|
|
172
|
+
"confirmPassword": "请再次输入密码"
|
|
173
|
+
},
|
|
174
|
+
"rule": {
|
|
175
|
+
"confirmPasswordRequired": "请再次输入密码",
|
|
176
|
+
"passwordMismatch": "两次输入密码不一致!",
|
|
177
|
+
"usernameLength": "长度在 3 到 20 个字符",
|
|
178
|
+
"passwordLength": "密码长度不能小于6位",
|
|
179
|
+
"agreementRequired": "请同意隐私协议"
|
|
180
|
+
},
|
|
181
|
+
"agreeText": "我同意",
|
|
182
|
+
"privacyPolicy": "《隐私政策》",
|
|
183
|
+
"submitBtnText": "注册",
|
|
184
|
+
"hasAccount": "已有账号?",
|
|
185
|
+
"toLogin": "去登录"
|
|
186
|
+
},
|
|
187
|
+
"greeting": {
|
|
188
|
+
"dawn": "凌晨了!",
|
|
189
|
+
"morning": "上午好!",
|
|
190
|
+
"afternoon": "下午好!",
|
|
191
|
+
"evening": "晚上好!"
|
|
192
|
+
},
|
|
193
|
+
"exceptionPage": {
|
|
194
|
+
"403": "抱歉,您无权访问该页面",
|
|
195
|
+
"404": "抱歉,您访问的页面不存在",
|
|
196
|
+
"500": "抱歉,服务器出错了",
|
|
197
|
+
"gohome": "返回首页"
|
|
198
|
+
},
|
|
199
|
+
"menus": {
|
|
200
|
+
"login": {
|
|
201
|
+
"title": "登录"
|
|
202
|
+
},
|
|
203
|
+
"register": {
|
|
204
|
+
"title": "注册"
|
|
205
|
+
},
|
|
206
|
+
"forgetPassword": {
|
|
207
|
+
"title": "忘记密码"
|
|
208
|
+
},
|
|
209
|
+
"outside": {
|
|
210
|
+
"title": "内嵌页面"
|
|
211
|
+
},
|
|
212
|
+
"dashboard": {
|
|
213
|
+
"title": "工作台",
|
|
214
|
+
"console": "模板概览"
|
|
215
|
+
},
|
|
216
|
+
"examples": {
|
|
217
|
+
"title": "模板示例",
|
|
218
|
+
"overview": "路由概览",
|
|
219
|
+
"searchTable": "搜索表格",
|
|
220
|
+
"crudWorkspace": "CRUD 工作台",
|
|
221
|
+
"analytics": "数据分析看板",
|
|
222
|
+
"complexForm": "复杂表单",
|
|
223
|
+
"permissions": "权限演练场",
|
|
224
|
+
"navigation": {
|
|
225
|
+
"title": "导航与缓存",
|
|
226
|
+
"state": "页面状态保留",
|
|
227
|
+
"detail": "导航详情"
|
|
228
|
+
},
|
|
229
|
+
"result": {
|
|
230
|
+
"title": "结果页面",
|
|
231
|
+
"success": "成功页",
|
|
232
|
+
"fail": "失败页"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"result": {
|
|
236
|
+
"title": "结果页面",
|
|
237
|
+
"success": "成功页",
|
|
238
|
+
"fail": "失败页"
|
|
239
|
+
},
|
|
240
|
+
"exception": {
|
|
241
|
+
"title": "异常页面",
|
|
242
|
+
"forbidden": "403",
|
|
243
|
+
"notFound": "404",
|
|
244
|
+
"serverError": "500"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"table": {
|
|
248
|
+
"toolbar": {
|
|
249
|
+
"toggleSearch": "显示或隐藏搜索条件",
|
|
250
|
+
"refresh": "刷新表格",
|
|
251
|
+
"density": "调整表格密度",
|
|
252
|
+
"fullscreen": "切换表格全屏",
|
|
253
|
+
"columns": "设置显示列",
|
|
254
|
+
"settings": "表格样式设置"
|
|
255
|
+
},
|
|
256
|
+
"form": {
|
|
257
|
+
"reset": "重置",
|
|
258
|
+
"submit": "提交"
|
|
259
|
+
},
|
|
260
|
+
"searchBar": {
|
|
261
|
+
"reset": "重置",
|
|
262
|
+
"search": "查询",
|
|
263
|
+
"expand": "展开",
|
|
264
|
+
"collapse": "收起",
|
|
265
|
+
"searchInputPlaceholder": "请输入",
|
|
266
|
+
"searchSelectPlaceholder": "请选择"
|
|
267
|
+
},
|
|
268
|
+
"selection": "选择",
|
|
269
|
+
"sizeOptions": {
|
|
270
|
+
"small": "紧凑",
|
|
271
|
+
"default": "默认",
|
|
272
|
+
"large": "宽松"
|
|
273
|
+
},
|
|
274
|
+
"column": {
|
|
275
|
+
"selection": "勾选",
|
|
276
|
+
"expand": "展开",
|
|
277
|
+
"index": "序号"
|
|
278
|
+
},
|
|
279
|
+
"zebra": "斑马纹",
|
|
280
|
+
"border": "边框",
|
|
281
|
+
"headerBackground": "表头背景"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import App from './App.vue'
|
|
2
|
+
import { createApp } from 'vue'
|
|
3
|
+
import { initStore } from './store' // Store
|
|
4
|
+
import { initRouter } from './router' // Router
|
|
5
|
+
import language from './locales' // 国际化
|
|
6
|
+
import '@styles/core/tailwind.css' // tailwind
|
|
7
|
+
import '@styles/index.scss' // 样式
|
|
8
|
+
import '@kevairy/components/style.css' // 公共组件样式
|
|
9
|
+
import '@utils/sys/console.ts' // 控制台输出内容
|
|
10
|
+
import { setupGlobDirectives } from './directives'
|
|
11
|
+
import { setupErrorHandle } from './utils/sys/error-handle'
|
|
12
|
+
import { initializeApp } from './bootstrap/initializeApp'
|
|
13
|
+
|
|
14
|
+
initializeApp()
|
|
15
|
+
|
|
16
|
+
document.addEventListener(
|
|
17
|
+
'touchstart',
|
|
18
|
+
function () {},
|
|
19
|
+
{ passive: false }
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
const app = createApp(App)
|
|
23
|
+
initStore(app)
|
|
24
|
+
initRouter(app)
|
|
25
|
+
setupGlobDirectives(app)
|
|
26
|
+
setupErrorHandle(app)
|
|
27
|
+
|
|
28
|
+
app.use(language)
|
|
29
|
+
app.mount('#app')
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HttpError } from '@/utils/http/error'
|
|
2
|
+
import { ApiStatus } from '@/utils/http/status'
|
|
3
|
+
import { $t } from '@/locales'
|
|
4
|
+
|
|
5
|
+
export const MOCK_AUTH_ACCOUNT = {
|
|
6
|
+
username: 'admin',
|
|
7
|
+
password: '123456'
|
|
8
|
+
} as const
|
|
9
|
+
|
|
10
|
+
const MOCK_ACCESS_TOKEN = 'admin-template-mock-access-token'
|
|
11
|
+
const MOCK_DELAY = 250
|
|
12
|
+
|
|
13
|
+
export async function mockLogin(params: Api.Auth.LoginParams): Promise<Api.Auth.LoginResponse> {
|
|
14
|
+
await delay()
|
|
15
|
+
|
|
16
|
+
if (
|
|
17
|
+
params.username !== MOCK_AUTH_ACCOUNT.username ||
|
|
18
|
+
params.password !== MOCK_AUTH_ACCOUNT.password
|
|
19
|
+
) {
|
|
20
|
+
throw new HttpError($t('login.invalidCredentials'), ApiStatus.unauthorized)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
accessToken: MOCK_ACCESS_TOKEN,
|
|
25
|
+
refreshToken: 'admin-template-mock-refresh-token'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function mockGetUserInfo(): Promise<Api.Auth.UserInfo> {
|
|
30
|
+
await delay()
|
|
31
|
+
return {
|
|
32
|
+
userId: 'admin',
|
|
33
|
+
userName: '模板管理员',
|
|
34
|
+
email: 'admin@example.com',
|
|
35
|
+
roles: ['R_SUPER'],
|
|
36
|
+
buttons: ['*:*:*']
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export async function mockLogout(): Promise<void> {
|
|
41
|
+
await delay(120)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function delay(ms = MOCK_DELAY): Promise<void> {
|
|
45
|
+
return new Promise((resolve) => setTimeout(resolve, ms))
|
|
46
|
+
}
|