@pubinfo/core 2.0.0-beta.8 → 2.0.0-rc.1
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/dist/{AppSetting-BQT7OI6K.js → AppSetting-Bblni_W7.js} +37 -39
- package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-D4u_haxr.js → HCheckList.vue_vue_type_script_setup_true_lang-A7PnhNKK.js} +12 -14
- package/dist/HDivider.vue_vue_type_script_setup_true_lang-DIHR-9Yv.js +20 -0
- package/dist/HToggle-xibvPpmf.js +34 -0
- package/dist/PreferencesContent--JtPw_LT.js +923 -0
- package/dist/{SettingBreadcrumb-CgugOTgx.js → SettingBreadcrumb-BwhdAtkC.js} +9 -9
- package/dist/{SettingCopyright-BPeCJBLi.js → SettingCopyright-DPsRDagL.js} +8 -8
- package/dist/{SettingEnableTransition-BK0_EH_N.js → SettingEnableTransition-mtHTUb08.js} +20 -21
- package/dist/{SettingHome-DGnxlXLd.js → SettingHome-agxHFIKq.js} +20 -20
- package/dist/{SettingMenu-BqAd9zbL.js → SettingMenu-D6WwcOw-.js} +26 -26
- package/dist/{SettingMode-CgA3XDwW.js → SettingMode-CkmhszlD.js} +11 -12
- package/dist/{SettingNavSearch-WFnkcRQ3.js → SettingNavSearch-CEB5DZGf.js} +9 -9
- package/dist/{SettingOther-CG4RI6mO.js → SettingOther-Dzs1uwnC.js} +13 -13
- package/dist/SettingPage-bOThkL2-.js +29 -0
- package/dist/{SettingTabbar-CQA6ZT9l.js → SettingTabbar-L6yQxAeE.js} +18 -18
- package/dist/SettingThemes-Cxa5bR66.js +142 -0
- package/dist/{SettingToolbar-DdR2940j.js → SettingToolbar-BZ2uHom2.js} +10 -10
- package/dist/{SettingTopbar-C_jYO_Ax.js → SettingTopbar-hptxTh8m.js} +16 -16
- package/dist/{SettingWidthMode-ir_28SE3.js → SettingWidthMode-D2R2W4-n.js} +19 -20
- package/dist/{TopThinMode-jHDpKsma.js → TopThinMode-C26i10py.js} +1 -1
- package/dist/built-in/authentication/helper.d.ts +1 -0
- package/dist/built-in/authentication/index.d.ts +10 -0
- package/dist/built-in/authentication/interface.d.ts +7 -0
- package/dist/built-in/authentication/router.d.ts +2 -0
- package/dist/built-in/authorization/directives.d.ts +2 -0
- package/dist/built-in/authorization/helper.d.ts +6 -0
- package/dist/built-in/authorization/index.d.ts +7 -0
- package/dist/built-in/authorization/router.d.ts +3 -0
- package/dist/built-in/index.d.ts +8 -0
- package/dist/{layout → built-in/layout-component}/Layout.vue.d.ts +2 -2
- package/dist/{layout → built-in/layout-component}/components/Header/TopMode/More.vue.d.ts +1 -1
- package/dist/{layout → built-in/layout-component}/components/Header/TopMode/NotCursor.vue.d.ts +2 -0
- package/dist/{layout → built-in/layout-component}/components/Menu/sub.vue.d.ts +43 -43
- package/dist/{layout → built-in/layout-component}/components/Menu/types.d.ts +1 -1
- package/dist/{layout → built-in/layout-component}/components/Tools/Search.vue.d.ts +43 -43
- package/dist/{layout/components/Topbar/Tabbar/MoreAction.vue.d.ts → built-in/layout-component/components/Tools/index.vue.d.ts} +18 -2
- package/dist/{layout/components/Tools/index.vue.d.ts → built-in/layout-component/components/Topbar/Tabbar/MoreAction.vue.d.ts} +45 -61
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HDialog.vue.d.ts +1 -1
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HSlideover.vue.d.ts +1 -1
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HTabList.vue.d.ts +2 -2
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HTooltip.vue.d.ts +1 -1
- package/dist/{layout → built-in/layout-component}/composables/useContext.d.ts +1 -1
- package/dist/{layout → built-in/layout-component}/composables/useHotkey.d.ts +1 -1
- package/dist/{layout → built-in/layout-component}/composables/useMenu.d.ts +1 -1
- package/dist/{layout → built-in/layout-component}/index.d.ts +5 -4
- package/dist/built-in/layout-component/utils/eventBus.d.ts +5 -0
- package/dist/built-in/layout-component/utils/index.d.ts +3 -0
- package/dist/{utils → built-in/layout-component/utils}/watermark.d.ts +1 -1
- package/dist/built-in/locales/helpler.d.ts +594 -0
- package/dist/built-in/locales/index.d.ts +5 -0
- package/dist/built-in/n-progress/index.d.ts +6 -0
- package/dist/built-in/pinia-plugin/enum.d.ts +1 -0
- package/dist/built-in/pinia-plugin/index.d.ts +5 -0
- package/dist/built-in/pinia-plugin/plugins/persist.d.ts +3 -0
- package/dist/built-in/pre-access/index.d.ts +7 -0
- package/dist/built-in/settings/index.d.ts +5 -0
- package/dist/built-in/settings/router.d.ts +3 -0
- package/dist/{colors-gu4NABiz.js → colors-C8I6Fdyp.js} +1 -1
- package/dist/core/create.d.ts +2 -0
- package/dist/core/ctx.d.ts +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/interface.d.ts +74 -0
- package/dist/{modules.d.ts → core/modules.d.ts} +9 -0
- package/dist/{api/index.d.ts → core/request.d.ts} +2 -4
- package/dist/core/resolver/icon.d.ts +5 -0
- package/dist/core/resolver/index.d.ts +4 -0
- package/dist/core/resolver/layout.d.ts +2 -0
- package/dist/core/resolver/page.d.ts +17 -0
- package/dist/core/resolver/resolver.d.ts +10 -0
- package/dist/{api → features/api}/modules/auth/renzhengfuwu.d.ts +7 -0
- package/dist/{api → features/api}/modules/configData/index.d.ts +1 -1
- package/dist/{api → features/api}/modules/rbac/pubJiaosezukongzhiqi.d.ts +7 -0
- package/dist/{api → features/api}/modules/rbac/ziyuanjiekou.d.ts +7 -0
- package/dist/features/api/request.d.ts +2 -0
- package/dist/{assets → features/assets}/styles/index.d.ts +2 -3
- package/dist/{composables → features/composables}/auth.d.ts +1 -1
- package/dist/features/context/index.d.ts +12 -0
- package/dist/features/enum.d.ts +21 -0
- package/dist/features/index.d.ts +7 -0
- package/dist/features/router/asyncRoutes.d.ts +14 -0
- package/dist/features/router/index.d.ts +2 -0
- package/dist/features/router/systemRoutes.d.ts +9 -0
- package/dist/features/stores/index.d.ts +1 -0
- package/dist/{stores → features/stores}/modules/favorites.d.ts +2 -2
- package/dist/{stores → features/stores}/modules/route.d.ts +6 -6
- package/dist/{stores → features/stores}/modules/tabbar.d.ts +1 -1
- package/dist/features/stores/modules/user.d.ts +36 -0
- package/dist/features/stores/utils/crypto.d.ts +1 -0
- package/dist/features/stores/utils/index.d.ts +2 -0
- package/dist/features/stores/utils/routerHelper.d.ts +17 -0
- package/dist/{reload-CUcPYtl7.js → index-BD2fkZis.js} +5 -5
- package/dist/index-CkyHqPON.js +139 -0
- package/dist/{index-NpS61xSA.js → index-D3zjK9rd.js} +54 -54
- package/dist/index-D948mfZb.js +49 -0
- package/dist/{index-CWIfG62O.js → index-DZ6SbWiv.js} +1804 -1897
- package/dist/{index-CjsnFBwd.js → index-DdS6qgK_.js} +7733 -8240
- package/dist/index-DeWCd_-p.js +44 -0
- package/dist/index-EOTrQlGo.js +258 -0
- package/dist/index-RwbJwutI.js +52514 -0
- package/dist/index-xzfvpJSq.js +234 -0
- package/dist/index.d.ts +23 -11
- package/dist/index.js +59 -72
- package/dist/pick-D6j4F3UM.js +12 -0
- package/dist/style.css +3 -3
- package/dist/utils/index.d.ts +4 -13
- package/dist/utils/path.d.ts +1 -0
- package/dist/utils/proxy.d.ts +1 -0
- package/dist/utils/storage.d.ts +1 -2
- package/package.json +41 -43
- package/src/built-in/authentication/helper.ts +55 -0
- package/src/built-in/authentication/index.ts +42 -0
- package/src/built-in/authentication/interface.ts +7 -0
- package/src/{pages/system → built-in/authentication/pages}/change-organization/index.vue +29 -43
- package/src/built-in/authentication/pages/change-password/assets/login-small.png +0 -0
- package/src/built-in/authentication/pages/change-password/assets/login-small_dark.webp +0 -0
- package/src/{pages/system → built-in/authentication/pages}/change-password/components/ChangePasswordForm/index.vue +1 -1
- package/src/{pages/system → built-in/authentication/pages}/change-password/index.vue +19 -36
- package/src/built-in/authentication/router.ts +57 -0
- package/src/{directives/plugins/permission.ts → built-in/authorization/directives.ts} +6 -7
- package/src/built-in/authorization/helper.ts +11 -0
- package/src/built-in/authorization/index.ts +25 -0
- package/src/{pages/system → built-in/authorization/pages}/not-permission/index.vue +9 -13
- package/src/{route/guard/auth.ts → built-in/authorization/router.ts} +39 -9
- package/src/built-in/index.ts +8 -0
- package/src/built-in/layout-component/Layout.vue +273 -0
- package/src/{layout → built-in/layout-component}/components/Content/IframeView.vue +1 -2
- package/src/{layout → built-in/layout-component}/components/Content/LinkView.vue +2 -2
- package/src/built-in/layout-component/components/Content/index.vue +146 -0
- package/src/{layout → built-in/layout-component}/components/Copyright/index.vue +7 -8
- package/src/{layout → built-in/layout-component}/components/Header/TopMode/More.vue +26 -34
- package/src/built-in/layout-component/components/Header/TopMode/NotCursor.vue +70 -0
- package/src/{layout → built-in/layout-component}/components/Header/TopMode/index.vue +14 -18
- package/src/built-in/layout-component/components/Header/index.vue +171 -0
- package/src/{layout → built-in/layout-component}/components/Logo/index.vue +5 -20
- package/src/{layout → built-in/layout-component}/components/Menu/index.vue +3 -3
- package/src/{layout → built-in/layout-component}/components/Menu/item.vue +22 -27
- package/src/{layout → built-in/layout-component}/components/Menu/types.ts +1 -1
- package/src/{layout → built-in/layout-component}/components/SettingBar/AppSetting.vue +11 -11
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/DayNightToggle.vue +26 -120
- package/src/built-in/layout-component/components/SettingBar/components/SettingEnableTransition.vue +190 -0
- package/src/built-in/layout-component/components/SettingBar/components/SettingMode.vue +154 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingThemes.vue +55 -90
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingWidthMode.vue +63 -71
- package/src/built-in/layout-component/components/SettingBar/index.vue +81 -0
- package/src/{layout → built-in/layout-component}/components/Sidebar/MainSidebar.vue +87 -135
- package/src/{layout → built-in/layout-component}/components/Sidebar/SubSidebar.vue +50 -59
- package/src/built-in/layout-component/components/Tools/Breadcrumb/index.vue +15 -0
- package/src/built-in/layout-component/components/Tools/DayNightSwitch.vue +70 -0
- package/src/{layout → built-in/layout-component}/components/Tools/Preferences/PreferencesContent.vue +214 -278
- package/src/{layout → built-in/layout-component}/components/Tools/Search.vue +5 -5
- package/src/{layout → built-in/layout-component}/components/Tools/index.vue +9 -15
- package/src/{layout → built-in/layout-component}/components/Topbar/Tabbar/MoreAction.vue +98 -145
- package/src/{layout → built-in/layout-component}/components/Topbar/Tabbar/index.vue +293 -405
- package/src/{layout → built-in/layout-component}/components/Topbar/Toolbar/Favorites.vue +5 -5
- package/src/{layout → built-in/layout-component}/components/Topbar/Toolbar/index.vue +40 -57
- package/src/{layout → built-in/layout-component}/components/Topbar/index.vue +16 -19
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HCheckList.vue +1 -1
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HDialog.vue +1 -1
- package/src/built-in/layout-component/components/ui/HDivider.vue +24 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HDropdownMenu.vue +1 -1
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HDropdownTree.vue +1 -1
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HSlideover.vue +1 -1
- package/src/built-in/layout-component/components/ui/HToggle.vue +133 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HTooltip.vue +1 -1
- package/src/{layout → built-in/layout-component}/composables/useContext.ts +2 -2
- package/src/{layout → built-in/layout-component}/composables/useGetComputedStyle.ts +1 -1
- package/src/{layout → built-in/layout-component}/composables/useHotkey.ts +1 -1
- package/src/{layout → built-in/layout-component}/composables/useMainPage.ts +2 -2
- package/src/{layout → built-in/layout-component}/composables/useMenu.ts +1 -1
- package/src/{layout → built-in/layout-component}/composables/useTabbar.ts +1 -1
- package/src/{layout → built-in/layout-component}/composables/useTitle.ts +1 -1
- package/src/{layout → built-in/layout-component}/composables/useWatermark.ts +4 -4
- package/src/{layout → built-in/layout-component}/index.ts +38 -16
- package/src/{layout → built-in/layout-component}/provider.ts +8 -2
- package/src/built-in/layout-component/utils/eventBus.ts +8 -0
- package/src/built-in/layout-component/utils/index.ts +3 -0
- package/src/{utils → built-in/layout-component/utils}/watermark.ts +2 -2
- package/src/{locales/index.ts → built-in/locales/helpler.ts} +13 -17
- package/src/built-in/locales/index.ts +20 -0
- package/src/built-in/n-progress/index.ts +31 -0
- package/src/built-in/n-progress/nprogress.css +68 -0
- package/src/built-in/pinia-plugin/enum.ts +1 -0
- package/src/{stores → built-in/pinia-plugin}/helper.ts +3 -3
- package/src/built-in/pinia-plugin/index.ts +27 -0
- package/src/{stores/plugin/sideEffect → built-in/pinia-plugin/plugins}/cleanup.ts +1 -1
- package/src/{stores/plugin/sideEffect → built-in/pinia-plugin/plugins}/favoritesStorage.ts +6 -7
- package/src/{stores/plugin/sideEffect → built-in/pinia-plugin/plugins}/iframeCache.ts +3 -3
- package/src/built-in/pinia-plugin/plugins/persist.ts +21 -0
- package/src/{stores/plugin/sideEffect → built-in/pinia-plugin/plugins}/tabbarStorage.ts +7 -8
- package/src/built-in/pre-access/index.ts +20 -0
- package/src/built-in/settings/index.ts +15 -0
- package/src/{route/guard/setting.ts → built-in/settings/router.ts} +3 -2
- package/src/core/create.ts +70 -0
- package/src/core/ctx.ts +3 -0
- package/src/core/index.ts +4 -0
- package/src/core/interface.ts +89 -0
- package/src/{modules.ts → core/modules.ts} +19 -5
- package/src/core/request.ts +52 -0
- package/src/core/resolver/icon.ts +75 -0
- package/src/core/resolver/index.ts +4 -0
- package/src/core/resolver/layout.ts +23 -0
- package/src/core/resolver/page.ts +89 -0
- package/src/core/resolver/resolver.ts +25 -0
- package/src/{api → features/api}/modules/auth/renzhengfuwu.ts +47 -15
- package/src/{api → features/api}/modules/auth/typings.d.ts +34 -28
- package/src/{api → features/api}/modules/configData/heibaimingdanfuwu.ts +13 -4
- package/src/{api → features/api}/modules/configData/index.ts +1 -1
- package/src/{api → features/api}/modules/configData/typings.d.ts +79 -79
- package/src/{api → features/api}/modules/configData/xitongpeizhifuwu.ts +43 -19
- package/src/{api/modules/configData/zidianfuwu.ts → features/api/modules/configData/zidifuwu.ts} +41 -11
- package/src/{api → features/api}/modules/rbac/gangweijiekou.ts +25 -10
- package/src/{api → features/api}/modules/rbac/jiaosejiekou.ts +25 -10
- package/src/{api → features/api}/modules/rbac/pubJiaosezukongzhiqi.ts +46 -7
- package/src/{api → features/api}/modules/rbac/shujuquanxianzhubiaokongzhiqi.ts +27 -13
- package/src/{api → features/api}/modules/rbac/typings.d.ts +323 -304
- package/src/{api → features/api}/modules/rbac/yonghujiekou.ts +49 -16
- package/src/{api → features/api}/modules/rbac/yonghushoucangbiaojiekou.ts +21 -6
- package/src/{api → features/api}/modules/rbac/yonghuzuijinchangyongbiaojiekou.ts +13 -4
- package/src/{api → features/api}/modules/rbac/ziyuanjiekou.ts +44 -5
- package/src/{api → features/api}/modules/rbac/zuhuguanlijiekou.ts +21 -12
- package/src/{api → features/api}/modules/rbac/zuzhijiaosebiaokongzhiqi.ts +13 -4
- package/src/{api → features/api}/modules/rbac/zuzhijiekou.ts +29 -11
- package/src/features/api/request.ts +5 -0
- package/src/{api → features/api}/system/user.ts +1 -1
- package/src/features/assets/styles/globals.css +188 -0
- package/src/{assets → features/assets}/styles/index.ts +2 -3
- package/src/features/assets/styles/rbac.css +51 -0
- package/src/features/assets/styles/resources/utils.css +53 -0
- package/src/features/assets/styles/resources/variables.css +5 -0
- package/src/features/components/MicroAppContainer/index.vue +9 -0
- package/src/features/components/NotAllowed/assets/403.svg +1 -0
- package/src/features/components/NotAllowed/assets/403_dark.svg +1 -0
- package/src/{components → features/components}/NotAllowed/index.vue +6 -8
- package/src/{components → features/components}/PassStrengthValidator/index.vue +33 -48
- package/src/{components → features/components}/PassStrengthValidator/rule.vue +13 -25
- package/src/{components → features/components}/PubinfoApp/index.vue +2 -1
- package/src/features/components/PubinfoIcon/index.vue +140 -0
- package/src/{components → features/components}/PubinfoProvider/index.ts +1 -2
- package/src/{composables → features/composables}/auth.ts +2 -2
- package/src/{composables → features/composables}/theme.ts +1 -1
- package/src/{composables → features/composables}/watchDiff.ts +1 -1
- package/src/features/context/index.ts +40 -0
- package/src/features/enum.ts +21 -0
- package/src/features/index.ts +8 -0
- package/src/{pages/system/[...all].vue → features/pages/not-found/index.vue} +6 -8
- package/src/{pages/personal → features/pages}/profile/index.vue +1 -1
- package/src/features/router/asyncRoutes.ts +35 -0
- package/src/features/router/index.ts +2 -0
- package/src/features/router/systemRoutes.ts +45 -0
- package/src/{config/settings.ts → features/settings/index.ts} +0 -1
- package/src/{stores/enum/index.ts → features/stores/enum.ts} +0 -1
- package/src/features/stores/index.ts +1 -0
- package/src/{stores → features/stores}/modules/keepAlive.ts +1 -0
- package/src/{stores → features/stores}/modules/menu.ts +44 -6
- package/src/{stores → features/stores}/modules/route.ts +89 -65
- package/src/{stores → features/stores}/modules/settings.ts +27 -10
- package/src/{stores → features/stores}/modules/tabbar.ts +8 -5
- package/src/{stores → features/stores}/modules/user.ts +60 -25
- package/src/{utils → features/stores/utils}/crypto.ts +7 -10
- package/src/features/stores/utils/index.ts +2 -0
- package/src/features/stores/utils/routerHelper.ts +221 -0
- package/src/index.ts +117 -12
- package/src/utils/cleanup.ts +1 -1
- package/src/utils/index.ts +4 -43
- package/src/utils/path.ts +5 -0
- package/src/utils/proxy.ts +36 -0
- package/src/utils/storage.ts +2 -4
- package/types/auto-imports.d.ts +3 -10
- package/types/components.d.ts +16 -15
- package/types/menu.d.ts +2 -0
- package/types/module.d.ts +2 -15
- package/types/settings.d.ts +0 -8
- package/types/tabbar.d.ts +1 -0
- package/types/vue-router.d.ts +11 -7
- package/dist/HButton.vue_vue_type_script_setup_true_lang-CYAzn9Mg.js +0 -25
- package/dist/HDivider-DgXBhPr0.js +0 -21
- package/dist/HToggle-Cd71WKvG.js +0 -34
- package/dist/PreferencesContent-MR1Db7z7.js +0 -972
- package/dist/SettingPage-C1CT1Mm8.js +0 -29
- package/dist/SettingThemes-BJu9czNK.js +0 -144
- package/dist/_...all_-18BnHmEa.js +0 -52
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/api/helper.d.ts +0 -32
- package/dist/api/interface.d.ts +0 -14
- package/dist/api/request.d.ts +0 -2
- package/dist/api/system/app.d.ts +0 -17
- package/dist/config/index.d.ts +0 -1
- package/dist/context.d.ts +0 -14
- package/dist/create.d.ts +0 -3
- package/dist/directives/index.d.ts +0 -4
- package/dist/directives/plugins/permission.d.ts +0 -6
- package/dist/index-C1p_tY7i.js +0 -49
- package/dist/index-CCPTQYuB.js +0 -12910
- package/dist/index-CNUEMTao.js +0 -354
- package/dist/index-CmXo8ShY.js +0 -276
- package/dist/index-DL8Y7jFG.js +0 -137
- package/dist/index-DTQQt_XY.js +0 -10
- package/dist/index-Dj8zy7hH.js +0 -230
- package/dist/index.vue_vue_type_style_index_0_scoped_fa1c6ee4_lang-BCo6Ft-Q.js +0 -2300
- package/dist/interface.d.ts +0 -29
- package/dist/locales/index.d.ts +0 -301
- package/dist/menu-CLiZ1BO_.js +0 -15315
- package/dist/pick-C9bU8_xv.js +0 -19
- package/dist/request.js +0 -1811
- package/dist/route/async.d.ts +0 -9
- package/dist/route/guard/auth.d.ts +0 -3
- package/dist/route/guard/basic.d.ts +0 -3
- package/dist/route/guard/index.d.ts +0 -3
- package/dist/route/guard/setting.d.ts +0 -3
- package/dist/route/index.d.ts +0 -7
- package/dist/route/routes.d.ts +0 -3
- package/dist/stores/index.d.ts +0 -5
- package/dist/stores/modules/user.d.ts +0 -4
- package/dist/stores/plugin/persist.d.ts +0 -5
- package/dist/stores/plugin/sideEffect/index.d.ts +0 -5
- package/dist/utils/crypto.d.ts +0 -4
- package/dist/utils/eventBus.d.ts +0 -5
- package/src/api/helper.ts +0 -64
- package/src/api/index.ts +0 -75
- package/src/api/interface.ts +0 -15
- package/src/api/request.ts +0 -4
- package/src/api/system/app.ts +0 -28
- package/src/assets/icons/add-child.svg +0 -1
- package/src/assets/icons/authority.svg +0 -1
- package/src/assets/icons/authorize.svg +0 -1
- package/src/assets/icons/blacklist-disable.svg +0 -1
- package/src/assets/icons/blacklist-enable.svg +0 -1
- package/src/assets/icons/browser-360.svg +0 -1
- package/src/assets/icons/browser-chrome.svg +0 -1
- package/src/assets/icons/browser-edge.svg +0 -1
- package/src/assets/icons/browser-ie.svg +0 -1
- package/src/assets/icons/browser-other.svg +0 -1
- package/src/assets/icons/browser-qq.svg +0 -1
- package/src/assets/icons/browser-safari.svg +0 -1
- package/src/assets/icons/browser-uc.svg +0 -1
- package/src/assets/icons/edit.svg +0 -1
- package/src/assets/icons/empty-data.svg +0 -1
- package/src/assets/icons/icard.svg +0 -1
- package/src/assets/icons/icon_animation.svg +0 -1
- package/src/assets/icons/icon_breadcrumb.svg +0 -1
- package/src/assets/icons/icon_copyright.svg +0 -1
- package/src/assets/icons/icon_jt.svg +0 -1
- package/src/assets/icons/icon_layout.svg +0 -1
- package/src/assets/icons/icon_mainpage.svg +0 -1
- package/src/assets/icons/icon_menu.svg +0 -1
- package/src/assets/icons/icon_page_size.svg +0 -1
- package/src/assets/icons/icon_position_type.svg +0 -1
- package/src/assets/icons/icon_safe_manage.svg +0 -1
- package/src/assets/icons/icon_screen_scale.svg +0 -6
- package/src/assets/icons/icon_system_manage.svg +0 -1
- package/src/assets/icons/icon_tabbar.svg +0 -1
- package/src/assets/icons/icon_toolbar.svg +0 -1
- package/src/assets/icons/icon_topbar.svg +0 -1
- package/src/assets/icons/icon_watermark.svg +0 -1
- package/src/assets/icons/image-load-fail.svg +0 -1
- package/src/assets/icons/log-center.svg +0 -1
- package/src/assets/icons/logo-sig.svg +0 -1
- package/src/assets/icons/not-data.svg +0 -1
- package/src/assets/icons/org-main.svg +0 -1
- package/src/assets/icons/org-unmain.svg +0 -1
- package/src/assets/icons/process-management.svg +0 -1
- package/src/assets/icons/project-management.svg +0 -1
- package/src/assets/icons/rbac.svg +0 -1
- package/src/assets/icons/remove.svg +0 -1
- package/src/assets/icons/resource-app.svg +0 -1
- package/src/assets/icons/resource-btn.svg +0 -1
- package/src/assets/icons/resource-index.svg +0 -1
- package/src/assets/icons/resource-menu.svg +0 -1
- package/src/assets/icons/resource-nonmenu.svg +0 -1
- package/src/assets/icons/setting-manage.svg +0 -1
- package/src/assets/icons/test.svg +0 -1
- package/src/assets/icons/theme-check-mark.svg +0 -1
- package/src/assets/icons/theme-title.svg +0 -1
- package/src/assets/icons/tree_icon.svg +0 -1
- package/src/assets/icons/tree_icon_checked.svg +0 -1
- package/src/assets/icons/view.svg +0 -1
- package/src/assets/icons/workbench.svg +0 -1
- package/src/assets/icons/zddata.svg +0 -1
- package/src/assets/icons/zy_checked.svg +0 -1
- package/src/assets/icons/zy_default.svg +0 -1
- package/src/assets/images/layout/item1.webp +0 -0
- package/src/assets/images/layout/item1_dark.webp +0 -0
- package/src/assets/images/layout/item2.webp +0 -0
- package/src/assets/images/layout/item2_dark.webp +0 -0
- package/src/assets/images/layout/item3.webp +0 -0
- package/src/assets/images/layout/item3_dark.webp +0 -0
- package/src/assets/images/layout/item4.webp +0 -0
- package/src/assets/images/layout/item4_dark.webp +0 -0
- package/src/assets/images/layout/item5.webp +0 -0
- package/src/assets/images/layout/item5_dark.webp +0 -0
- package/src/assets/images/page-width/anto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/auto.webp +0 -0
- package/src/assets/images/page-width/auto_dark.webp +0 -0
- package/src/assets/images/page-width/auto_min_w.webp +0 -0
- package/src/assets/images/page-width/auto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/icon_auto.webp +0 -0
- package/src/assets/images/page-width/icon_auto_dark.webp +0 -0
- package/src/assets/images/page-width/icon_auto_min_w.webp +0 -0
- package/src/assets/images/page-width/icon_auto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/icon_middle.webp +0 -0
- package/src/assets/images/page-width/icon_middle_dark.webp +0 -0
- package/src/assets/images/page-width/icon_middle_max_w.webp +0 -0
- package/src/assets/images/page-width/icon_middle_max_w_dark.webp +0 -0
- package/src/assets/images/page-width/middle.webp +0 -0
- package/src/assets/images/page-width/middle_dark.webp +0 -0
- package/src/assets/images/page-width/middle_max_w.webp +0 -0
- package/src/assets/images/page-width/middle_max_w_dark.webp +0 -0
- package/src/assets/styles/globals.scss +0 -189
- package/src/assets/styles/nprogress.scss +0 -63
- package/src/assets/styles/rbac.scss +0 -61
- package/src/assets/styles/resources/utils.scss +0 -53
- package/src/assets/styles/resources/variables.scss +0 -6
- package/src/components/PubinfoIcon/index.vue +0 -85
- package/src/config/index.ts +0 -1
- package/src/context.ts +0 -30
- package/src/create.ts +0 -88
- package/src/directives/index.ts +0 -6
- package/src/interface.ts +0 -35
- package/src/layout/Layout.vue +0 -330
- package/src/layout/components/Content/index.vue +0 -100
- package/src/layout/components/Header/TopMode/NotCursor.vue +0 -77
- package/src/layout/components/Header/index.vue +0 -263
- package/src/layout/components/SettingBar/components/SettingEnableTransition.vue +0 -215
- package/src/layout/components/SettingBar/components/SettingMode.vue +0 -164
- package/src/layout/components/SettingBar/index.vue +0 -112
- package/src/layout/components/Tools/Breadcrumb/index.vue +0 -21
- package/src/layout/components/Tools/DayNightSwitch.vue +0 -93
- package/src/layout/components/Tools/I18nSelector.vue +0 -52
- package/src/layout/ui-kit/HDivider.vue +0 -53
- package/src/layout/ui-kit/HToggle.vue +0 -177
- package/src/pages/system/change-password/page.vue +0 -58
- package/src/pages/system/index.vue +0 -5
- package/src/route/async.ts +0 -18
- package/src/route/guard/basic.ts +0 -23
- package/src/route/guard/index.ts +0 -3
- package/src/route/index.ts +0 -12
- package/src/route/routes.ts +0 -101
- package/src/stores/index.ts +0 -10
- package/src/stores/plugin/persist.ts +0 -27
- package/src/stores/plugin/sideEffect/index.ts +0 -15
- package/src/utils/eventBus.ts +0 -15
- package/dist/{api/enum/code.d.ts → built-in/authentication/enum.d.ts} +0 -0
- package/dist/{components/NotAllowed → built-in/authentication/pages/change-organization}/index.vue.d.ts +0 -0
- package/dist/{pages/system → built-in/authentication/pages}/change-password/components/ChangePasswordForm/index.vue.d.ts +0 -0
- package/dist/{pages/system → built-in/authentication/pages}/change-password/index.vue.d.ts +0 -0
- package/dist/{layout/components/Topbar/Toolbar → built-in/authorization/pages/not-permission}/index.vue.d.ts +0 -0
- package/dist/{components/PubinfoApp → built-in/layout-component/components/BackTop}/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Content/IframeView.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Content/LinkView.vue.d.ts +0 -0
- package/dist/{layout/components/BackTop → built-in/layout-component/components/Content}/index.vue.d.ts +0 -0
- package/dist/{layout/components/Content → built-in/layout-component/components/Copyright}/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Header/TopMode/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Header/TopThinMode.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Header/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Logo/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Menu/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Menu/item.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/AppSetting.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/DayNightToggle.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingBreadcrumb.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingCopyright.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingEnableTransition.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingHome.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingMenu.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingMode.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingNavSearch.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingOther.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingPage.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingTabbar.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingThemes.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingToolbar.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingTopbar.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/SettingBar/components/SettingWidthMode.vue.d.ts +0 -0
- package/dist/{layout/components/Copyright → built-in/layout-component/components/SettingBar}/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Sidebar/MainSidebar.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Sidebar/SubSidebar.vue.d.ts +0 -0
- package/dist/{layout/components/SettingBar → built-in/layout-component/components/Sidebar}/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Tools/Breadcrumb/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Tools/Breadcrumb/item.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Tools/DayNightSwitch.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Tools/HotkeysIntro.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Tools/Preferences/PreferencesContent.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Tools/Preferences/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Topbar/Tabbar/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Topbar/Toolbar/Favorites.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/components/Topbar/Toolbar/Star.vue.d.ts +0 -0
- package/dist/{layout/components/Topbar → built-in/layout-component/components/Topbar/Toolbar}/index.vue.d.ts +0 -0
- package/dist/{pages/personal/profile → built-in/layout-component/components/Topbar}/index.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HBadge.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HButton.vue.d.ts +1 -1
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HCheckList.vue.d.ts +2 -2
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HDivider.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HDropdown.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HDropdownMenu.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HDropdownTree.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HInput.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HKbd.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HSelect.vue.d.ts +0 -0
- package/dist/{layout/ui-kit → built-in/layout-component/components/ui}/HToggle.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/composables/useGetComputedStyle.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/composables/useMainPage.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/composables/useTabbar.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/composables/useTitle.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/composables/useViewTransition.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/composables/useWatermark.d.ts +0 -0
- package/dist/{pages/system/change-organization → built-in/layout-component/pages/reload}/index.vue.d.ts +0 -0
- package/dist/{layout → built-in/layout-component}/provider.d.ts +0 -0
- package/dist/{utils → built-in/layout-component/utils}/injectionKeys.d.ts +0 -0
- package/dist/{locales → built-in/locales}/lang/en.json.d.ts +0 -0
- package/dist/{locales → built-in/locales}/lang/zh-cn.json.d.ts +0 -0
- package/dist/{locales → built-in/locales}/lang/zh-tw.json.d.ts +0 -0
- package/dist/{locales → built-in/locales}/ui.d.ts +0 -0
- package/dist/{stores → built-in/pinia-plugin}/helper.d.ts +0 -0
- package/dist/{stores/plugin/sideEffect → built-in/pinia-plugin/plugins}/cleanup.d.ts +0 -0
- package/dist/{stores/plugin/sideEffect → built-in/pinia-plugin/plugins}/favoritesStorage.d.ts +0 -0
- package/dist/{stores/plugin/sideEffect → built-in/pinia-plugin/plugins}/iframeCache.d.ts +0 -0
- package/dist/{stores/plugin/sideEffect → built-in/pinia-plugin/plugins}/tabbarStorage.d.ts +0 -0
- package/dist/{utils → core}/utils.d.ts +0 -0
- package/dist/{api → features/api}/modules/auth/index.d.ts +0 -0
- package/dist/{api → features/api}/modules/configData/heibaimingdanfuwu.d.ts +0 -0
- package/dist/{api → features/api}/modules/configData/xitongpeizhifuwu.d.ts +0 -0
- package/dist/{api/modules/configData/zidianfuwu.d.ts → features/api/modules/configData/zidifuwu.d.ts} +0 -0
- package/dist/{api → features/api}/modules/rbac/gangweijiekou.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/index.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/jiaosejiekou.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/shujuquanxianzhubiaokongzhiqi.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/yonghujiekou.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/yonghushoucangbiaojiekou.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/yonghuzuijinchangyongbiaojiekou.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/zuhuguanlijiekou.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/zuzhijiaosebiaokongzhiqi.d.ts +0 -0
- package/dist/{api → features/api}/modules/rbac/zuzhijiekou.d.ts +0 -0
- package/dist/{api → features/api}/system/user.d.ts +0 -0
- package/dist/{pages/system → features/components/MicroAppContainer}/index.vue.d.ts +0 -0
- package/dist/{pages/system/not-permission → features/components/NotAllowed}/index.vue.d.ts +0 -0
- package/dist/{components → features/components}/PageHeader/index.vue.d.ts +0 -0
- package/dist/{components → features/components}/PageMain/index.vue.d.ts +0 -0
- package/dist/{components → features/components}/PassStrengthValidator/index.vue.d.ts +2 -2
- package/dist/{components → features/components}/PassStrengthValidator/rule.vue.d.ts +0 -0
- package/dist/{layout/components/Sidebar → features/components/PubinfoApp}/index.vue.d.ts +0 -0
- package/dist/{components → features/components}/PubinfoIcon/index.vue.d.ts +0 -0
- package/dist/{components → features/components}/PubinfoProvider/index.d.ts +0 -0
- package/dist/{components → features/components}/index.d.ts +0 -0
- package/dist/{composables → features/composables}/index.d.ts +0 -0
- package/dist/{composables → features/composables}/log.d.ts +0 -0
- package/dist/{composables → features/composables}/theme.d.ts +0 -0
- package/dist/{composables → features/composables}/watchDiff.d.ts +0 -0
- package/dist/{pages/system/[...all].vue.d.ts → features/pages/not-found/index.vue.d.ts} +0 -0
- package/dist/{pages/system/reload.vue.d.ts → features/pages/profile/index.vue.d.ts} +0 -0
- package/dist/{config/settings.d.ts → features/settings/index.d.ts} +0 -0
- package/dist/{stores/enum/index.d.ts → features/stores/enum.d.ts} +0 -0
- package/dist/{stores → features/stores}/modules/iframe.d.ts +0 -0
- package/dist/{stores → features/stores}/modules/index.d.ts +0 -0
- package/dist/{stores → features/stores}/modules/keepAlive.d.ts +0 -0
- package/dist/{stores → features/stores}/modules/menu.d.ts +0 -0
- package/dist/{stores → features/stores}/modules/settings.d.ts +0 -0
- package/src/{api/enum/code.ts → built-in/authentication/enum.ts} +0 -0
- package/src/{assets/icons → built-in/authentication/pages/change-organization/assets}/change-org.svg +0 -0
- package/src/{assets/images → built-in/authentication/pages/change-organization/assets}/login-small.png +0 -0
- package/src/{assets/images → built-in/authentication/pages/change-organization/assets}/login-small_dark.webp +0 -0
- package/src/{assets/icons → built-in/authentication/pages/change-password/assets}/mima.svg +0 -0
- package/src/{assets/icons → built-in/authorization/pages/not-permission}/403.svg +0 -0
- package/src/{assets/icons → built-in/authorization/pages/not-permission}/403_dark.svg +0 -0
- package/src/{assets → built-in/layout-component/assets}/icons/favorites.svg +0 -0
- package/src/{assets → built-in/layout-component/assets}/icons/toolbar-collapse.svg +0 -0
- package/src/{assets → built-in/layout-component/assets}/images/not-cursor.png +0 -0
- package/src/{layout → built-in/layout-component}/components/BackTop/index.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/Header/TopThinMode.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/Menu/sub.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingBreadcrumb.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingCopyright.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingHome.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingMenu.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingNavSearch.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingOther.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingPage.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingTabbar.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingToolbar.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/SettingBar/components/SettingTopbar.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/Sidebar/index.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/Tools/Breadcrumb/item.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/Tools/HotkeysIntro.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/Tools/Preferences/index.vue +0 -0
- package/src/{layout → built-in/layout-component}/components/Topbar/Toolbar/Star.vue +0 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HBadge.vue +0 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HButton.vue +0 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HDropdown.vue +0 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HInput.vue +0 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HKbd.vue +0 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HSelect.vue +0 -0
- package/src/{layout/ui-kit → built-in/layout-component/components/ui}/HTabList.vue +0 -0
- package/src/{layout → built-in/layout-component}/composables/useViewTransition.ts +0 -0
- package/src/{pages/system/reload.vue → built-in/layout-component/pages/reload/index.vue} +0 -0
- package/src/{utils → built-in/layout-component/utils}/injectionKeys.ts +0 -0
- package/src/{locales → built-in/locales}/lang/en.json +0 -0
- package/src/{locales → built-in/locales}/lang/zh-cn.json +0 -0
- package/src/{locales → built-in/locales}/lang/zh-tw.json +0 -0
- package/src/{locales → built-in/locales}/ui.ts +0 -0
- package/src/{utils → core}/utils.ts +0 -0
- package/src/{api → features/api}/modules/auth/index.ts +0 -0
- package/src/{api → features/api}/modules/rbac/index.ts +0 -0
- package/src/{api → features/api}/system/typings.d.ts +0 -0
- package/src/{assets → features/assets}/fonts/digital-7/digital-7-webfont.eot +0 -0
- package/src/{assets → features/assets}/fonts/digital-7/digital-7-webfont.svg +0 -0
- package/src/{assets → features/assets}/fonts/digital-7/digital-7-webfont.woff +0 -0
- package/src/{assets → features/assets}/fonts/digital-7/digital-7-webfont.woff2 +0 -0
- package/src/{assets → features/assets}/fonts/digital-7/stylesheet.css +0 -0
- package/src/{assets → features/assets}/fonts/digital-7_mono/digital-7_mono-webfont.eot +0 -0
- package/src/{assets → features/assets}/fonts/digital-7_mono/digital-7_mono-webfont.svg +0 -0
- package/src/{assets → features/assets}/fonts/digital-7_mono/digital-7_mono-webfont.woff +0 -0
- package/src/{assets → features/assets}/fonts/digital-7_mono/digital-7_mono-webfont.woff2 +0 -0
- package/src/{assets → features/assets}/fonts/digital-7_mono/stylesheet.css +0 -0
- package/src/{assets → features/assets}/fonts/title.otf +0 -0
- package/src/{assets → features/assets}/images/change-org-bc.webp +0 -0
- package/src/{assets → features/assets}/images/header-bg.png +0 -0
- package/src/{assets → features/assets}/images/logo.png +0 -0
- package/src/{assets → features/assets}/images/org.svg +0 -0
- package/src/{assets → features/assets}/images/slider-bg.png +0 -0
- package/src/{components → features/components}/PageHeader/index.vue +0 -0
- package/src/{components → features/components}/PageMain/index.vue +0 -0
- package/src/{components → features/components}/index.ts +0 -0
- package/src/{composables → features/composables}/index.ts +0 -0
- package/src/{composables → features/composables}/log.ts +0 -0
- package/src/{assets/icons → features/pages/not-found/assets}/404.svg +0 -0
- package/src/{assets/icons → features/pages/not-found/assets}/404_dark.svg +0 -0
- package/src/{stores → features/stores}/modules/favorites.ts +1 -1
- /package/src/{stores → features/stores}/modules/iframe.ts +0 -0
- /package/src/{stores → features/stores}/modules/index.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { useSettingsStore } from '@/stores';
|
|
1
|
+
import type { RequestMethod } from '@/core';
|
|
3
2
|
import { cloneDeep } from 'lodash-es';
|
|
4
3
|
import { createI18n as _createI18n } from 'vue-i18n';
|
|
4
|
+
import { useSettingsStore } from '@/features/stores';
|
|
5
5
|
import _en from './lang/en.json';
|
|
6
6
|
import _zhCN from './lang/zh-cn.json';
|
|
7
7
|
import _zhTW from './lang/zh-tw.json';
|
|
@@ -13,7 +13,7 @@ const messages = {
|
|
|
13
13
|
'zh-tw': _zhTW,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
function createI18n() {
|
|
16
|
+
export function createI18n() {
|
|
17
17
|
const settingsStore = useSettingsStore();
|
|
18
18
|
// 如果没设置默认语言,则根据当前浏览器语言设置默认语言
|
|
19
19
|
if (!settingsStore.settings.app.defaultLang) {
|
|
@@ -36,11 +36,11 @@ function createI18n() {
|
|
|
36
36
|
return i18n;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
function getLocales() {
|
|
39
|
+
export function getLocales() {
|
|
40
40
|
return cloneDeep(messages);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function getUILocales() {
|
|
43
|
+
export function getUILocales() {
|
|
44
44
|
const locales: {
|
|
45
45
|
[key: string]: any
|
|
46
46
|
} = {};
|
|
@@ -62,19 +62,15 @@ function getUILocales() {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// 用于路由 meta.i18n 配置,方便在 VSCode I18n Ally 插件进行显示,无实际作用
|
|
65
|
-
function $t(key: string) {
|
|
65
|
+
export function $t(key: string) {
|
|
66
66
|
return key;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
/**
|
|
70
|
+
* 根据请求方法设置语言。
|
|
71
|
+
* @param method 请求方法
|
|
72
|
+
*/
|
|
73
|
+
export function maybeSetLanguage(method: RequestMethod) {
|
|
74
|
+
const settingsStore = useSettingsStore();
|
|
75
|
+
method.config.headers['Accept-Language'] = settingsStore.settings.app.defaultLang;
|
|
73
76
|
}
|
|
74
|
-
|
|
75
|
-
export {
|
|
76
|
-
$t,
|
|
77
|
-
getLocales,
|
|
78
|
-
getUILocales,
|
|
79
|
-
setupI18n,
|
|
80
|
-
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ModuleOptions } from '@/core';
|
|
2
|
+
import { createI18n, maybeSetLanguage } from './helpler';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 国际化多语言
|
|
6
|
+
*/
|
|
7
|
+
export function Locales(): ModuleOptions {
|
|
8
|
+
return {
|
|
9
|
+
name: 'built-in:locales',
|
|
10
|
+
setup(ctx) {
|
|
11
|
+
const { app } = ctx;
|
|
12
|
+
app.use(createI18n());
|
|
13
|
+
},
|
|
14
|
+
hooks: {
|
|
15
|
+
'http:request': (method) => {
|
|
16
|
+
maybeSetLanguage(method);
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ModuleOptions } from '@/core';
|
|
2
|
+
import { useNProgress } from '@vueuse/integrations/useNProgress';
|
|
3
|
+
import { useSettingsStore } from '@/features';
|
|
4
|
+
import './nprogress.css';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 页面跳转进度条
|
|
8
|
+
*/
|
|
9
|
+
export function NProgress(): ModuleOptions {
|
|
10
|
+
return {
|
|
11
|
+
name: 'built-in:n-progress',
|
|
12
|
+
setup(ctx) {
|
|
13
|
+
const { router } = ctx;
|
|
14
|
+
|
|
15
|
+
const settingsStore = useSettingsStore();
|
|
16
|
+
const { start, done } = useNProgress();
|
|
17
|
+
|
|
18
|
+
if (settingsStore.settings.app.enableProgress) {
|
|
19
|
+
router.beforeEach((to, from) => {
|
|
20
|
+
if (to.path !== from.path) {
|
|
21
|
+
start();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
router.afterEach(() => {
|
|
26
|
+
done();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#nprogress {
|
|
2
|
+
pointer-events: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
#nprogress .bar {
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
z-index: 1031;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 2px;
|
|
12
|
+
background: rgb(var(--ui-primary));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#nprogress .peg {
|
|
16
|
+
position: absolute;
|
|
17
|
+
right: 0;
|
|
18
|
+
display: block;
|
|
19
|
+
width: 100px;
|
|
20
|
+
height: 100%;
|
|
21
|
+
box-shadow: 0 0 10px rgb(var(--ui-primary)), 0 0 5px rgb(var(--ui-primary));
|
|
22
|
+
opacity: 1;
|
|
23
|
+
-webkit-transform: rotate(3deg) translate(0, -4px);
|
|
24
|
+
-moz-transform: rotate(3deg) translate(0, -4px);
|
|
25
|
+
-ms-transform: rotate(3deg) translate(0, -4px);
|
|
26
|
+
transform: rotate(3deg) translate(0, -4px);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#nprogress .spinner {
|
|
30
|
+
position: fixed;
|
|
31
|
+
top: 11px;
|
|
32
|
+
right: 14px;
|
|
33
|
+
z-index: 1031;
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#nprogress .spinner .spinner-icon {
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
width: 18px;
|
|
40
|
+
height: 18px;
|
|
41
|
+
border: solid 2px transparent;
|
|
42
|
+
border-top-color: rgb(var(--ui-primary));
|
|
43
|
+
border-left-color: rgb(var(--ui-primary));
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
-webkit-animation: nprogress-spinner 400ms linear infinite;
|
|
46
|
+
-moz-animation: nprogress-spinner 400ms linear infinite;
|
|
47
|
+
-ms-animation: nprogress-spinner 400ms linear infinite;
|
|
48
|
+
animation: nprogress-spinner 400ms linear infinite;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.nprogress-custom-parent {
|
|
52
|
+
position: relative;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.nprogress-custom-parent #nprogress .spinner,
|
|
57
|
+
.nprogress-custom-parent #nprogress .bar {
|
|
58
|
+
position: absolute;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@keyframes nprogress-spinner {
|
|
62
|
+
0% {
|
|
63
|
+
transform: rotate(0deg);
|
|
64
|
+
}
|
|
65
|
+
100% {
|
|
66
|
+
transform: rotate(360deg);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { STORE_NAME } from '@/features/stores/enum';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import md5 from 'md5';
|
|
2
|
-
import useUserStore from '
|
|
2
|
+
import { useUserStore } from '@/features/stores';
|
|
3
3
|
|
|
4
4
|
const { getHash } = createHashString();
|
|
5
5
|
|
|
@@ -13,8 +13,8 @@ export function getfavoritesMemoryKey() {
|
|
|
13
13
|
|
|
14
14
|
function getUserPrefix() {
|
|
15
15
|
const userStore = useUserStore();
|
|
16
|
-
const userId = userStore.userId;
|
|
17
|
-
const orgId = userStore.orgId;
|
|
16
|
+
const userId = userStore.user.userId;
|
|
17
|
+
const orgId = userStore.user.orgId;
|
|
18
18
|
return getHash(`${orgId}${userId}`);
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ModuleOptions } from '@/core';
|
|
2
|
+
import { createPersistedState } from 'pinia-plugin-persistedstate';
|
|
3
|
+
import { createCleanupPlugin } from './plugins/cleanup';
|
|
4
|
+
import { createFavoritesStoragePlugin } from './plugins/favoritesStorage';
|
|
5
|
+
import { createIframeCachePlugin } from './plugins/iframeCache';
|
|
6
|
+
import { createPersistedStateOptions } from './plugins/persist';
|
|
7
|
+
import { createTabbarStoragePlugin } from './plugins/tabbarStorage';
|
|
8
|
+
/**
|
|
9
|
+
* pinia 统一注册插件
|
|
10
|
+
*/
|
|
11
|
+
export function PiniaPlugin(): ModuleOptions {
|
|
12
|
+
return {
|
|
13
|
+
name: 'built-in:pinia-plugin',
|
|
14
|
+
setup(ctx) {
|
|
15
|
+
const { store } = ctx;
|
|
16
|
+
|
|
17
|
+
// 持久化
|
|
18
|
+
store.use(createPersistedState(createPersistedStateOptions()));
|
|
19
|
+
|
|
20
|
+
// 各个store的副作用
|
|
21
|
+
store.use(createCleanupPlugin);
|
|
22
|
+
store.use(createFavoritesStoragePlugin);
|
|
23
|
+
store.use(createIframeCachePlugin);
|
|
24
|
+
store.use(createTabbarStoragePlugin);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { PiniaPluginContext } from 'pinia';
|
|
2
|
-
import type useFavoritesStore from '
|
|
3
|
-
import { GetAPIFavorites, GetAPIFavoritesEdit } from '@/api/system/user';
|
|
2
|
+
import type { useFavoritesStore } from '@/features/stores';
|
|
3
|
+
import { GetAPIFavorites, GetAPIFavoritesEdit } from '@/features/api/system/user';
|
|
4
|
+
import { useSettingsStore, useUserStore } from '@/features/stores';
|
|
4
5
|
import { storage } from '@/utils';
|
|
5
|
-
import { STORE_NAME } from '
|
|
6
|
-
import { getfavoritesMemoryKey } from '
|
|
7
|
-
import useSettingsStore from '../../modules/settings';
|
|
8
|
-
import useUserStore from '../../modules/user';
|
|
6
|
+
import { STORE_NAME } from '../enum';
|
|
7
|
+
import { getfavoritesMemoryKey } from '../helper';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* 收藏夹持久化插件
|
|
@@ -13,7 +12,7 @@ import useUserStore from '../../modules/user';
|
|
|
13
12
|
export function createFavoritesStoragePlugin({ store }: PiniaPluginContext) {
|
|
14
13
|
if (store.$id === STORE_NAME.FAVORITES) {
|
|
15
14
|
const favoritesStore = store as ReturnType<typeof useFavoritesStore>;
|
|
16
|
-
const favoritesId = computed(() => useUserStore().account);
|
|
15
|
+
const favoritesId = computed(() => useUserStore().user.account);
|
|
17
16
|
const settingsStore = useSettingsStore();
|
|
18
17
|
|
|
19
18
|
// list 变化时更新存储
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PiniaPluginContext } from 'pinia';
|
|
2
|
-
import type useIframeStore from '
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import type { useIframeStore } from '@/features/stores';
|
|
3
|
+
import { useSettingsStore } from '@/features/stores';
|
|
4
|
+
import { STORE_NAME } from '../enum';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 最大缓存数量检测,超过缓存数量则关闭最早打开的 iframe
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PluginOptions, Serializer } from 'pinia-plugin-persistedstate';
|
|
2
|
+
import { storage } from '@/utils';
|
|
3
|
+
|
|
4
|
+
export function customSerializer(): Serializer {
|
|
5
|
+
return {
|
|
6
|
+
deserialize: (value) => {
|
|
7
|
+
return JSON.parse(value);
|
|
8
|
+
},
|
|
9
|
+
serialize: (value) => {
|
|
10
|
+
return JSON.stringify(value);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createPersistedStateOptions(): PluginOptions {
|
|
16
|
+
return {
|
|
17
|
+
storage: storage.local,
|
|
18
|
+
key: id => `_${id}`,
|
|
19
|
+
serializer: customSerializer(),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { PiniaPluginContext } from 'pinia';
|
|
2
|
-
import type useTabbarStore from '
|
|
3
|
-
import { GetAPITabbar, GetAPITabbarEdit } from '@/api/system/user';
|
|
4
|
-
import { storage } from '@/utils';
|
|
2
|
+
import type { useTabbarStore } from '@/features/stores';
|
|
5
3
|
import { cloneDeep } from 'lodash-es';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
4
|
+
import { GetAPITabbar, GetAPITabbarEdit } from '@/features/api/system/user';
|
|
5
|
+
import { useSettingsStore, useUserStore } from '@/features/stores';
|
|
6
|
+
import { storage } from '@/utils';
|
|
7
|
+
import { STORE_NAME } from '../enum';
|
|
8
|
+
import { getTabbarMemoryKey } from '../helper';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* 选项卡持久化插件
|
|
@@ -14,7 +13,7 @@ import useUserStore from '../../modules/user';
|
|
|
14
13
|
export function createTabbarStoragePlugin({ store }: PiniaPluginContext) {
|
|
15
14
|
if (store.$id === STORE_NAME.TABBAR) {
|
|
16
15
|
const tabbarStore = store as ReturnType<typeof useTabbarStore>;
|
|
17
|
-
const tabbarId = computed(() => useUserStore().account);
|
|
16
|
+
const tabbarId = computed(() => useUserStore().user.account);
|
|
18
17
|
const settingsStore = useSettingsStore();
|
|
19
18
|
|
|
20
19
|
// list 变化时更新存储
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ModuleOptions } from '@/core';
|
|
2
|
+
import { basic as request } from '@/features/api/request';
|
|
3
|
+
|
|
4
|
+
function validateIp() {
|
|
5
|
+
return request.Post<API.IsSuccess>('/validateIp', {}, { meta: { authRole: null } });
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 入口访问控制 (系统级拦截)
|
|
10
|
+
*
|
|
11
|
+
* 例如,黑白名单检测、防火墙规则等
|
|
12
|
+
*/
|
|
13
|
+
export function PreAccess(): ModuleOptions {
|
|
14
|
+
return {
|
|
15
|
+
name: 'built-in:pre-access',
|
|
16
|
+
async setup() {
|
|
17
|
+
await validateIp();
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ModuleOptions } from '@/core';
|
|
2
|
+
import { createRouterGuard } from './router';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 配置项
|
|
6
|
+
*/
|
|
7
|
+
export function Settings(): ModuleOptions {
|
|
8
|
+
return {
|
|
9
|
+
name: 'built-in:settings',
|
|
10
|
+
setup(ctx) {
|
|
11
|
+
const { router } = ctx;
|
|
12
|
+
createRouterGuard(router);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RouterMetaRawBaseOptions } from '#/vue-router';
|
|
2
2
|
import type { Router } from 'vue-router';
|
|
3
|
+
import { useError } from '@/features/composables';
|
|
3
4
|
import {
|
|
4
5
|
useIframeStore,
|
|
5
6
|
useKeepAliveStore,
|
|
@@ -7,10 +8,10 @@ import {
|
|
|
7
8
|
useSettingsStore,
|
|
8
9
|
useTabbarStore,
|
|
9
10
|
useUserStore,
|
|
10
|
-
} from '@/stores';
|
|
11
|
+
} from '@/features/stores';
|
|
11
12
|
|
|
12
13
|
/** 配置路由守卫 */
|
|
13
|
-
export function
|
|
14
|
+
export function createRouterGuard(router: Router) {
|
|
14
15
|
const settingsStore = useSettingsStore();
|
|
15
16
|
const menuStore = useMenuStore();
|
|
16
17
|
const tabbarStore = useTabbarStore();
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Context, Options } from './interface';
|
|
2
|
+
import { createPinia } from 'pinia';
|
|
3
|
+
import { createApp as createVueApp } from 'vue';
|
|
4
|
+
import { createRouter, createWebHashHistory } from 'vue-router';
|
|
5
|
+
|
|
6
|
+
import { extractModules, resolveHooks, resolveModules } from './modules';
|
|
7
|
+
import { loadProjectModules } from './resolver';
|
|
8
|
+
|
|
9
|
+
export function createApp(options: Options) {
|
|
10
|
+
const {
|
|
11
|
+
app: App,
|
|
12
|
+
router: routerOptions,
|
|
13
|
+
setup,
|
|
14
|
+
rootContainer = '#app',
|
|
15
|
+
immediate = true,
|
|
16
|
+
modules = [],
|
|
17
|
+
hooks: _hooks = {},
|
|
18
|
+
} = options;
|
|
19
|
+
|
|
20
|
+
async function _createApp() {
|
|
21
|
+
await loadProjectModules();
|
|
22
|
+
|
|
23
|
+
const app = createVueApp(App);
|
|
24
|
+
const store = createPinia();
|
|
25
|
+
app.use(store);
|
|
26
|
+
|
|
27
|
+
const { base, ...restRouterOptions } = routerOptions;
|
|
28
|
+
const router = createRouter({
|
|
29
|
+
history: createWebHashHistory(base),
|
|
30
|
+
...restRouterOptions,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const context: Context = {
|
|
34
|
+
app,
|
|
35
|
+
store,
|
|
36
|
+
router,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// 解析插件
|
|
40
|
+
const resolvedModules = extractModules(modules);
|
|
41
|
+
|
|
42
|
+
// 注册 hooks
|
|
43
|
+
resolveHooks([
|
|
44
|
+
...resolvedModules.pre,
|
|
45
|
+
...resolvedModules.default,
|
|
46
|
+
{ hooks: _hooks },
|
|
47
|
+
...resolvedModules.post,
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
await resolveModules(resolvedModules.pre, context);
|
|
51
|
+
await resolveModules(resolvedModules.default, context);
|
|
52
|
+
await setup?.(context);
|
|
53
|
+
await resolveModules(resolvedModules.post, context);
|
|
54
|
+
|
|
55
|
+
// router 必须放在最后注册
|
|
56
|
+
app.use(router);
|
|
57
|
+
|
|
58
|
+
return context;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (immediate) {
|
|
62
|
+
(async () => {
|
|
63
|
+
const { app, router } = await _createApp();
|
|
64
|
+
await router.isReady();
|
|
65
|
+
app.mount(rootContainer, true);
|
|
66
|
+
})();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return _createApp;
|
|
70
|
+
}
|
package/src/core/ctx.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { AdapterCreateOptions, AlovaAxiosRequestConfig } from '@alova/adapter-axios';
|
|
2
|
+
import type { Alova, AlovaGenerics, AlovaOptions, Method } from 'alova';
|
|
3
|
+
import type { AxiosResponse, AxiosResponseHeaders } from 'axios';
|
|
4
|
+
import type { Pinia } from 'pinia';
|
|
5
|
+
import type { App, Component } from 'vue';
|
|
6
|
+
import type { Router, RouterOptions as VueRouterOptions } from 'vue-router';
|
|
7
|
+
|
|
8
|
+
type PartialKeys<T, Keys extends keyof T> = Omit<T, Keys> & Partial<Pick<T, Keys>>;
|
|
9
|
+
|
|
10
|
+
export type RouterOptions = PartialKeys<VueRouterOptions, 'history'> & { base?: string };
|
|
11
|
+
|
|
12
|
+
export interface Options {
|
|
13
|
+
/**
|
|
14
|
+
* 根组件
|
|
15
|
+
*/
|
|
16
|
+
app: Component
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* vue-router 配置
|
|
20
|
+
*/
|
|
21
|
+
router: RouterOptions
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 初始化函数
|
|
25
|
+
*/
|
|
26
|
+
setup?: Setup
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 根节点
|
|
30
|
+
* @default "#app"
|
|
31
|
+
*/
|
|
32
|
+
rootContainer?: string | Element
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 立即执行
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
immediate?: boolean
|
|
39
|
+
|
|
40
|
+
/** 模块插件注册 */
|
|
41
|
+
modules?: ModuleOptions[]
|
|
42
|
+
|
|
43
|
+
/** 生命周期 */
|
|
44
|
+
hooks?: Partial<Hooks>
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface Context {
|
|
48
|
+
app: App<Element>
|
|
49
|
+
store: Pinia
|
|
50
|
+
router: Router
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type Setup = (ctx: Pick<Context, 'app' | 'router' | 'store'>) => Promise<void> | void;
|
|
54
|
+
|
|
55
|
+
export interface Module {
|
|
56
|
+
/** 唯一值 */
|
|
57
|
+
name: string
|
|
58
|
+
|
|
59
|
+
/** 初始化内容 */
|
|
60
|
+
setup?: Setup
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 插件调用顺序:
|
|
64
|
+
* - `enforce: pre` 插件
|
|
65
|
+
* - 内置核心插件(即路由守卫、状态管理等)
|
|
66
|
+
* - 普通插件
|
|
67
|
+
* - 初始化函数(即setup)
|
|
68
|
+
* - `enforce: post` 插件
|
|
69
|
+
*/
|
|
70
|
+
enforce?: 'pre' | 'post'
|
|
71
|
+
|
|
72
|
+
/** 钩子函数 */
|
|
73
|
+
hooks?: Partial<Hooks>
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type FalsyModule = false | null | undefined;
|
|
77
|
+
|
|
78
|
+
export type ModuleOptions = Module | ModuleOptions[] | FalsyModule;
|
|
79
|
+
|
|
80
|
+
type AG = AlovaGenerics<any, any, AlovaAxiosRequestConfig, AxiosResponse<any, any>, AxiosResponseHeaders, any, any, any>;
|
|
81
|
+
|
|
82
|
+
export type RequestOptions = Omit<AlovaOptions<AG>, 'statesHook' | 'requestAdapter'> & { axios?: AdapterCreateOptions };
|
|
83
|
+
export type RequestInstance = Alova<AG>;
|
|
84
|
+
export type RequestMethod = Method<AG>;
|
|
85
|
+
|
|
86
|
+
export interface Hooks {
|
|
87
|
+
'http:request': AlovaOptions<AG>['beforeRequest']
|
|
88
|
+
'http:response': AlovaOptions<AG>['responded']
|
|
89
|
+
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import type { Context, FalsyModule, Module, ModuleOptions } from './interface';
|
|
2
|
-
import { hooks } from './
|
|
2
|
+
import { hooks } from './ctx';
|
|
3
3
|
import { asyncFlatten } from './utils';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 注册所有模块插件的setup
|
|
7
|
+
*/
|
|
5
8
|
export async function resolveModules(modules: ModuleOptions[] = [], context: Context) {
|
|
6
9
|
const filterModules = (m: Module | FalsyModule): m is Module => Boolean(m);
|
|
7
10
|
|
|
8
11
|
const rawModules = (await asyncFlatten(modules)).filter(filterModules);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
for (const m of rawModules) {
|
|
14
|
+
if (m.setup) {
|
|
15
|
+
await m.setup(context);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
/**
|
|
@@ -47,3 +52,12 @@ export function extractModules(modules: ModuleOptions[] = []) {
|
|
|
47
52
|
modules?.forEach(traverse);
|
|
48
53
|
return result;
|
|
49
54
|
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 注册所有模块插件的hook
|
|
58
|
+
*/
|
|
59
|
+
export function resolveHooks(modules: { hooks?: Module['hooks'] }[]) {
|
|
60
|
+
modules.forEach((m) => {
|
|
61
|
+
hooks.addHooks(m?.hooks ?? {});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { RequestOptions } from './interface';
|
|
2
|
+
import { axiosRequestAdapter } from '@alova/adapter-axios';
|
|
3
|
+
import { createAlova } from 'alova';
|
|
4
|
+
import vueHook from 'alova/vue';
|
|
5
|
+
import { createTokenAuthentication } from '@/built-in';
|
|
6
|
+
import { hooks } from './ctx';
|
|
7
|
+
|
|
8
|
+
function normalizedResponded(handler: RequestOptions['responded']) {
|
|
9
|
+
if (typeof handler === 'function') {
|
|
10
|
+
return { onSuccess: handler };
|
|
11
|
+
}
|
|
12
|
+
return handler;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createRequest(options: RequestOptions) {
|
|
16
|
+
const { onAuthRequired, onResponseRefreshToken } = createTokenAuthentication();
|
|
17
|
+
const { axios, beforeRequest, responded: _responded, ...restOptions } = options;
|
|
18
|
+
|
|
19
|
+
const responded = normalizedResponded(_responded);
|
|
20
|
+
|
|
21
|
+
const instance = createAlova({
|
|
22
|
+
statesHook: vueHook,
|
|
23
|
+
requestAdapter: axiosRequestAdapter(axios),
|
|
24
|
+
cacheFor: null,
|
|
25
|
+
timeout: 60 * 1000,
|
|
26
|
+
...restOptions,
|
|
27
|
+
|
|
28
|
+
beforeRequest: onAuthRequired(async (method) => {
|
|
29
|
+
await hooks.callHook('http:request', method);
|
|
30
|
+
await beforeRequest?.(method);
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
responded: onResponseRefreshToken({
|
|
34
|
+
onSuccess: async (response, method) => {
|
|
35
|
+
const res = await hooks.callHook('http:response:onSuccess', response, method) ?? response;
|
|
36
|
+
return responded?.onSuccess?.(res, method) ?? res;
|
|
37
|
+
},
|
|
38
|
+
onError: (err, method) => {
|
|
39
|
+
hooks.callHook('http:response:onError', err, method);
|
|
40
|
+
responded?.onError?.(err, method);
|
|
41
|
+
},
|
|
42
|
+
onComplete: (method) => {
|
|
43
|
+
hooks.callHook('http:response:onComplete', method);
|
|
44
|
+
responded?.onComplete?.(method);
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return instance;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export * from './interface';
|