create-meadminjs 1.0.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/bin/cli.js +3 -0
- package/bin/index.js +3 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +97 -0
- package/dist/file-zuupOgeh.js +78 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +98 -0
- package/package.json +38 -0
- package/template/meadmin/.editorconfig +11 -0
- package/template/meadmin/.env +21 -0
- package/template/meadmin/.eslintrc.json +7 -0
- package/template/meadmin/.husky/pre-commit +4 -0
- package/template/meadmin/.mocharc.json +6 -0
- package/template/meadmin/.prettierignore +30 -0
- package/template/meadmin/.prettierrc.cjs +47 -0
- package/template/meadmin/.vscode/extensions.json +3 -0
- package/template/meadmin/.vscode/settings.json +28 -0
- package/template/meadmin/README.md +41 -0
- package/template/meadmin/bootstrap.js +2 -0
- package/template/meadmin/meadmin.sql +571 -0
- package/template/meadmin/nx.json +10 -0
- package/template/meadmin/packageTemplate.json +80 -0
- package/template/meadmin/pnpm-workspace.yaml +4 -0
- package/template/meadmin/public/admin/.gitkeep +0 -0
- package/template/meadmin/public/index/.gitkeep +0 -0
- package/template/meadmin/public/index/images/layout/bannerCode.jpg +0 -0
- package/template/meadmin/public/index/images/layout/bannerGift.jpg +0 -0
- package/template/meadmin/public/index/images/layout/bannerManage.jpg +0 -0
- package/template/meadmin/src/app/admin/controller/base.controller.ts +6 -0
- package/template/meadmin/src/app/admin/controller/example/demo.controller.ts +98 -0
- package/template/meadmin/src/app/admin/controller/file.controller.ts +105 -0
- package/template/meadmin/src/app/admin/controller/login.controller.ts +81 -0
- package/template/meadmin/src/app/admin/controller/system/admin.controller.ts +73 -0
- package/template/meadmin/src/app/admin/controller/system/menu.controller.ts +80 -0
- package/template/meadmin/src/app/admin/controller/system/role.controller.ts +81 -0
- package/template/meadmin/src/app/admin/controller/user.controller.ts +86 -0
- package/template/meadmin/src/app/admin/controller/userFile.controller.ts +84 -0
- package/template/meadmin/src/app/admin/dto/captchaResult.dto.ts +8 -0
- package/template/meadmin/src/app/admin/dto/example/demoCreate.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/example/demoQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/example/demoUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/fileCreate.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/fileQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/fileUp.dto.ts +28 -0
- package/template/meadmin/src/app/admin/dto/fileUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/loginCaptchaParam.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/loginInfoResult.dto.ts +24 -0
- package/template/meadmin/src/app/admin/dto/loginParam.dto.ts +13 -0
- package/template/meadmin/src/app/admin/dto/loginResult.dto.ts +10 -0
- package/template/meadmin/src/app/admin/dto/system/adminCreate.dto.ts +14 -0
- package/template/meadmin/src/app/admin/dto/system/adminQuery.dto.ts +30 -0
- package/template/meadmin/src/app/admin/dto/system/adminUpdate.dto.ts +24 -0
- package/template/meadmin/src/app/admin/dto/system/menuCreate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/system/menuQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/system/menuTreeAllResult.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/system/menuUpdate.dto.ts +8 -0
- package/template/meadmin/src/app/admin/dto/system/roleCreate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/system/roleQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/system/roleTreeAllResult.dto.ts +12 -0
- package/template/meadmin/src/app/admin/dto/system/roleUpdate.dto.ts +14 -0
- package/template/meadmin/src/app/admin/dto/userCreate.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/userFileCreate.dto.ts +9 -0
- package/template/meadmin/src/app/admin/dto/userFileQuery.dto.ts +20 -0
- package/template/meadmin/src/app/admin/dto/userFileUp.dto.ts +28 -0
- package/template/meadmin/src/app/admin/dto/userFileUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/dto/userQuery.dto.ts +26 -0
- package/template/meadmin/src/app/admin/dto/userUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/admin/middleware/admin.middleware.ts +41 -0
- package/template/meadmin/src/app/admin/service/example/demo.service.ts +260 -0
- package/template/meadmin/src/app/admin/service/file.service.ts +123 -0
- package/template/meadmin/src/app/admin/service/login.serveice.ts +209 -0
- package/template/meadmin/src/app/admin/service/system/admin.service.ts +206 -0
- package/template/meadmin/src/app/admin/service/system/menu.service.ts +133 -0
- package/template/meadmin/src/app/admin/service/system/role.service.ts +161 -0
- package/template/meadmin/src/app/admin/service/user.service.ts +205 -0
- package/template/meadmin/src/app/admin/service/userFile.service.ts +126 -0
- package/template/meadmin/src/app/home.controller.ts +19 -0
- package/template/meadmin/src/app/index/controller/base.controller.ts +6 -0
- package/template/meadmin/src/app/index/controller/file.controller.ts +116 -0
- package/template/meadmin/src/app/index/controller/index.controller.ts +70 -0
- package/template/meadmin/src/app/index/controller/login.controller.ts +81 -0
- package/template/meadmin/src/app/index/controller/user.controller.ts +43 -0
- package/template/meadmin/src/app/index/dto/captchaResult.dto.ts +8 -0
- package/template/meadmin/src/app/index/dto/fileCreate.dto.ts +9 -0
- package/template/meadmin/src/app/index/dto/fileQuery.dto.ts +20 -0
- package/template/meadmin/src/app/index/dto/fileUp.dto.ts +28 -0
- package/template/meadmin/src/app/index/dto/fileUpdate.dto.ts +11 -0
- package/template/meadmin/src/app/index/dto/loginCaptchaParam.dto.ts +9 -0
- package/template/meadmin/src/app/index/dto/loginParam.dto.ts +13 -0
- package/template/meadmin/src/app/index/dto/loginResult.dto.ts +10 -0
- package/template/meadmin/src/app/index/dto/userCreate.dto.ts +26 -0
- package/template/meadmin/src/app/index/dto/userUpdate.dto.ts +33 -0
- package/template/meadmin/src/app/index/middleware/index.middleware.ts +28 -0
- package/template/meadmin/src/app/index/service/file.service.ts +127 -0
- package/template/meadmin/src/app/index/service/login.serveice.ts +178 -0
- package/template/meadmin/src/app/index/service/user.service.ts +87 -0
- package/template/meadmin/src/config/config.default.ts +154 -0
- package/template/meadmin/src/config/config.unittest.ts +7 -0
- package/template/meadmin/src/config/database.ts +30 -0
- package/template/meadmin/src/configuration.ts +107 -0
- package/template/meadmin/src/controller/api.controller.ts +21 -0
- package/template/meadmin/src/decorators/admin/permission.ts +41 -0
- package/template/meadmin/src/decorators/index/permission.ts +37 -0
- package/template/meadmin/src/decorators/index.ts +61 -0
- package/template/meadmin/src/decorators/sequelize.ts +65 -0
- package/template/meadmin/src/decorators/swagger.ts +170 -0
- package/template/meadmin/src/decorators/transactions.ts +42 -0
- package/template/meadmin/src/dict/code.enum.ts +8 -0
- package/template/meadmin/src/dto/page.dto.ts +16 -0
- package/template/meadmin/src/entities/abstract/adminBase.entity.ts +35 -0
- package/template/meadmin/src/entities/abstract/adminTree.entity.ts +258 -0
- package/template/meadmin/src/entities/abstract/base.entity.ts +69 -0
- package/template/meadmin/src/entities/abstract/indexBase.entity.ts +39 -0
- package/template/meadmin/src/entities/exampleBook.entity.ts +22 -0
- package/template/meadmin/src/entities/exampleDemo.entity.ts +104 -0
- package/template/meadmin/src/entities/file.entity.ts +68 -0
- package/template/meadmin/src/entities/systemAdmin.entity.ts +164 -0
- package/template/meadmin/src/entities/systemMenu.entity.ts +161 -0
- package/template/meadmin/src/entities/systemRole.entity.ts +99 -0
- package/template/meadmin/src/entities/user.entity.ts +160 -0
- package/template/meadmin/src/entities/userFile.entity.ts +68 -0
- package/template/meadmin/src/fileManage/index.ts +12 -0
- package/template/meadmin/src/fileManage/storage/base.ts +6 -0
- package/template/meadmin/src/fileManage/storage/local.ts +93 -0
- package/template/meadmin/src/filter/badRequest.filter.ts +14 -0
- package/template/meadmin/src/filter/default.filter.ts +28 -0
- package/template/meadmin/src/filter/forbidden.filter.ts +15 -0
- package/template/meadmin/src/filter/index.ts +6 -0
- package/template/meadmin/src/filter/notfound.filter.ts +10 -0
- package/template/meadmin/src/filter/unauthorized.filter.ts +15 -0
- package/template/meadmin/src/filter/validate.filter.ts +23 -0
- package/template/meadmin/src/helper/dotenv.ts +13 -0
- package/template/meadmin/src/helper/dto.ts +195 -0
- package/template/meadmin/src/helper/snowflake.ts +50 -0
- package/template/meadmin/src/helper/utils.ts +57 -0
- package/template/meadmin/src/interface.ts +12 -0
- package/template/meadmin/src/locales/en.json +13 -0
- package/template/meadmin/src/logger.ts +24 -0
- package/template/meadmin/src/middleware/report.middleware.ts +23 -0
- package/template/meadmin/src/response/apiBase.res.ts +12 -0
- package/template/meadmin/src/response/apiError.res.ts +6 -0
- package/template/meadmin/src/response/apiPage.res.ts +19 -0
- package/template/meadmin/src/response/apiSuccess.res.ts +17 -0
- package/template/meadmin/src/ruleType/index.ts +3 -0
- package/template/meadmin/src/ruleType/string.ts +29 -0
- package/template/meadmin/src/service/dataSourceManager.service.ts +55 -0
- package/template/meadmin/src/service/response.service.ts +65 -0
- package/template/meadmin/src/types/decorator.ts +31 -0
- package/template/meadmin/src/types/entity.ts +209 -0
- package/template/meadmin/src/types/fileManage.ts +48 -0
- package/template/meadmin/src/types/koa.interface.ts +12 -0
- package/template/meadmin/src/types/uploadOptions.ts +7 -0
- package/template/meadmin/test/controller/api.test.ts +17 -0
- package/template/meadmin/test/controller/home.test.ts +18 -0
- package/template/meadmin/test/setup.ts +15 -0
- package/template/meadmin/test/tsconfig.json +19 -0
- package/template/meadmin/tsconfig.json +28 -0
- package/template/meadmin/types/mwtsc.d.ts +9 -0
- package/template/meadmin/uploadFile/admin/.gitkeep +0 -0
- package/template/meadmin/uploadFile/index/.gitkeep +0 -0
- package/template/meadmin/view/admin/.prettierignore +28 -0
- package/template/meadmin/view/admin/.prettierrc.cjs +4 -0
- package/template/meadmin/view/admin/cli/autoImport.ts +3 -0
- package/template/meadmin/view/admin/eslint.config.js +91 -0
- package/template/meadmin/view/admin/index.html +65 -0
- package/template/meadmin/view/admin/packageTemplate.json +123 -0
- package/template/meadmin/view/admin/plugins/autoComponents.ts +10 -0
- package/template/meadmin/view/admin/plugins/autoImport.ts +64 -0
- package/template/meadmin/view/admin/plugins/autoImportApi.ts +14 -0
- package/template/meadmin/view/admin/plugins/babel.ts +25 -0
- package/template/meadmin/view/admin/plugins/index.ts +107 -0
- package/template/meadmin/view/admin/plugins/svgLoader.ts +22 -0
- package/template/meadmin/view/admin/plugins/vueSetUpExtend.ts +5 -0
- package/template/meadmin/view/admin/public/favicon.ico +0 -0
- package/template/meadmin/view/admin/public/logo.png +0 -0
- package/template/meadmin/view/admin/public/logo.svg +1 -0
- package/template/meadmin/view/admin/src/App.vue +46 -0
- package/template/meadmin/view/admin/src/api/api.model.ts +11 -0
- package/template/meadmin/view/admin/src/api/example/demo.ts +189 -0
- package/template/meadmin/view/admin/src/api/file.ts +124 -0
- package/template/meadmin/view/admin/src/api/login.ts +55 -0
- package/template/meadmin/view/admin/src/api/system/admin.ts +111 -0
- package/template/meadmin/view/admin/src/api/system/menu.ts +125 -0
- package/template/meadmin/view/admin/src/api/system/role.ts +111 -0
- package/template/meadmin/view/admin/src/api/user.ts +106 -0
- package/template/meadmin/view/admin/src/api/userFile.ts +121 -0
- package/template/meadmin/view/admin/src/app.ts +13 -0
- package/template/meadmin/view/admin/src/assets/images/404.svg +339 -0
- package/template/meadmin/view/admin/src/assets/images/captcha.png +0 -0
- package/template/meadmin/view/admin/src/components/meButton.vue +39 -0
- package/template/meadmin/view/admin/src/components/meComponent.ts +73 -0
- package/template/meadmin/view/admin/src/components/meDarkSwitch.vue +36 -0
- package/template/meadmin/view/admin/src/components/meDialog/hooks/minMax.ts +163 -0
- package/template/meadmin/view/admin/src/components/meDialog/index.vue +86 -0
- package/template/meadmin/view/admin/src/components/meFilesView.vue +52 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/Suspense.ts +15 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/apiAsyncComponent.ts +3 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/component.ts +5 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/componentPublicInstance.ts +6 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/devtools.ts +43 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/errorHandling.ts +17 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/renderer.ts +103 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/shapeFlags.ts +13 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/core/vnode.ts +9 -0
- package/template/meadmin/view/admin/src/components/meKeepAlive/index.ts +347 -0
- package/template/meadmin/view/admin/src/components/meLocaleSelect.vue +34 -0
- package/template/meadmin/view/admin/src/components/meNumber.vue +74 -0
- package/template/meadmin/view/admin/src/components/meSearchForm.vue +175 -0
- package/template/meadmin/view/admin/src/components/meSearchMenu/index.vue +87 -0
- package/template/meadmin/view/admin/src/components/meSearchMenu/useSearchMenu.ts +87 -0
- package/template/meadmin/view/admin/src/components/meSelectFile/index.vue +87 -0
- package/template/meadmin/view/admin/src/components/meSelectFile/meSelectFile.ts +3 -0
- package/template/meadmin/view/admin/src/components/meSelectList.vue +80 -0
- package/template/meadmin/view/admin/src/components/meSelectUserFile/index.vue +96 -0
- package/template/meadmin/view/admin/src/components/meSelectUserFile/meSelectUserFile.ts +3 -0
- package/template/meadmin/view/admin/src/components/meSetting.vue +20 -0
- package/template/meadmin/view/admin/src/components/meSettingMenu.vue +152 -0
- package/template/meadmin/view/admin/src/components/meSizeSelect.vue +28 -0
- package/template/meadmin/view/admin/src/components/meUpload.vue +114 -0
- package/template/meadmin/view/admin/src/components/meUploadUserFile.vue +114 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/components/pagination.vue +67 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/directives/resize.ts +31 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/index.vue +287 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/install.ts +30 -0
- package/template/meadmin/view/admin/src/components/meVxeTable/util.ts +11 -0
- package/template/meadmin/view/admin/src/components/meWangEditor/index.vue +121 -0
- package/template/meadmin/view/admin/src/components/meWangEditor/meWangEditor.scss +24 -0
- package/template/meadmin/view/admin/src/components/page.vue +24 -0
- package/template/meadmin/view/admin/src/components/service/meImageViewer.ts +23 -0
- package/template/meadmin/view/admin/src/config/index.ts +11 -0
- package/template/meadmin/view/admin/src/config/locale.ts +245 -0
- package/template/meadmin/view/admin/src/config/login.ts +5 -0
- package/template/meadmin/view/admin/src/config/theme.ts +19 -0
- package/template/meadmin/view/admin/src/dict/configEnum.ts +5 -0
- package/template/meadmin/view/admin/src/dict/eventEnmu.ts +14 -0
- package/template/meadmin/view/admin/src/dict/menuModeEnum.ts +5 -0
- package/template/meadmin/view/admin/src/dict/pageEnum.ts +6 -0
- package/template/meadmin/view/admin/src/directives/clickOutside.ts +2 -0
- package/template/meadmin/view/admin/src/entry-client.ts +8 -0
- package/template/meadmin/view/admin/src/entry-server.ts +69 -0
- package/template/meadmin/view/admin/src/env.d.ts +6 -0
- package/template/meadmin/view/admin/src/event/index.ts +30 -0
- package/template/meadmin/view/admin/src/event/module.ts +1 -0
- package/template/meadmin/view/admin/src/event/modules/core.ts +27 -0
- package/template/meadmin/view/admin/src/hooks/actionModel.ts +54 -0
- package/template/meadmin/view/admin/src/hooks/core/computedProxy.ts +10 -0
- package/template/meadmin/view/admin/src/hooks/index.ts +24 -0
- package/template/meadmin/view/admin/src/icons/index.ts +52 -0
- package/template/meadmin/view/admin/src/icons/svg/dashboard.svg +5 -0
- package/template/meadmin/view/admin/src/icons/svg/moon.svg +5 -0
- package/template/meadmin/view/admin/src/icons/svg/size.svg +5 -0
- package/template/meadmin/view/admin/src/icons/svg/sunny.svg +5 -0
- package/template/meadmin/view/admin/src/icons/svg/translation.svg +5 -0
- package/template/meadmin/view/admin/src/layout/components/expand.vue +18 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/tagBar/components/contextmenu.vue +180 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/tagBar/index.vue +322 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/left.vue +59 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/right/components/messageBox.vue +82 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/right/components/user.vue +53 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/right/index.vue +44 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/components/topMenu.vue +33 -0
- package/template/meadmin/view/admin/src/layout/components/header/components/topBar/index.vue +30 -0
- package/template/meadmin/view/admin/src/layout/components/header/index.vue +15 -0
- package/template/meadmin/view/admin/src/layout/components/menu/components/menuItem.vue +72 -0
- package/template/meadmin/view/admin/src/layout/components/menu/index.vue +147 -0
- package/template/meadmin/view/admin/src/layout/components/page.vue +33 -0
- package/template/meadmin/view/admin/src/layout/components/title.vue +21 -0
- package/template/meadmin/view/admin/src/layout/index.vue +104 -0
- package/template/meadmin/view/admin/src/locales/helper.ts +127 -0
- package/template/meadmin/view/admin/src/locales/hooks.ts +50 -0
- package/template/meadmin/view/admin/src/locales/i18n.ts +16 -0
- package/template/meadmin/view/admin/src/locales/lang/en/default.json +65 -0
- package/template/meadmin/view/admin/src/locales/lang/en/index.ts +7 -0
- package/template/meadmin/view/admin/src/locales/lang/en/meTable.json +7 -0
- package/template/meadmin/view/admin/src/locales/lang/en/meVxeTable.ts +11 -0
- package/template/meadmin/view/admin/src/locales/lang/en/menu.json +1 -0
- package/template/meadmin/view/admin/src/locales/lang/en/rule.json +12 -0
- package/template/meadmin/view/admin/src/locales/lang/zh-cn/default.json +6 -0
- package/template/meadmin/view/admin/src/locales/lang/zh-cn/index.ts +7 -0
- package/template/meadmin/view/admin/src/locales/lang/zh-cn/meVxeTable.ts +2 -0
- package/template/meadmin/view/admin/src/main.ts +21 -0
- package/template/meadmin/view/admin/src/router/constant.ts +2 -0
- package/template/meadmin/view/admin/src/router/guard/index.ts +52 -0
- package/template/meadmin/view/admin/src/router/index.ts +115 -0
- package/template/meadmin/view/admin/src/setElGlobel.ts +16 -0
- package/template/meadmin/view/admin/src/store/index.ts +8 -0
- package/template/meadmin/view/admin/src/store/modules/global.ts +66 -0
- package/template/meadmin/view/admin/src/store/modules/route.ts +69 -0
- package/template/meadmin/view/admin/src/store/modules/setting.ts +46 -0
- package/template/meadmin/view/admin/src/store/modules/user.ts +115 -0
- package/template/meadmin/view/admin/src/styles/element-plus.scss +40 -0
- package/template/meadmin/view/admin/src/styles/index.scss +122 -0
- package/template/meadmin/view/admin/src/styles/transition.scss +33 -0
- package/template/meadmin/view/admin/src/styles/variables.scss +5 -0
- package/template/meadmin/view/admin/src/utils/fileMd5Work.ts +109 -0
- package/template/meadmin/view/admin/src/utils/fileUpload.ts +154 -0
- package/template/meadmin/view/admin/src/utils/formatting.ts +62 -0
- package/template/meadmin/view/admin/src/utils/helper.ts +315 -0
- package/template/meadmin/view/admin/src/utils/loading.ts +63 -0
- package/template/meadmin/view/admin/src/utils/log.ts +8 -0
- package/template/meadmin/view/admin/src/utils/mitt.ts +152 -0
- package/template/meadmin/view/admin/src/utils/nProgress.ts +31 -0
- package/template/meadmin/view/admin/src/utils/permission.ts +76 -0
- package/template/meadmin/view/admin/src/utils/request.ts +152 -0
- package/template/meadmin/view/admin/src/utils/userFileUpload.ts +154 -0
- package/template/meadmin/view/admin/src/utils/validate.ts +17 -0
- package/template/meadmin/view/admin/src/views/404.vue +50 -0
- package/template/meadmin/view/admin/src/views/example/demo/components/addOrUp.vue +118 -0
- package/template/meadmin/view/admin/src/views/example/demo/components/info.vue +56 -0
- package/template/meadmin/view/admin/src/views/example/demo/dict.ts +8 -0
- package/template/meadmin/view/admin/src/views/example/demo/index.vue +126 -0
- package/template/meadmin/view/admin/src/views/example/demo/lang/dict.ts +8 -0
- package/template/meadmin/view/admin/src/views/example/demo/lang/en.json +14 -0
- package/template/meadmin/view/admin/src/views/file/components/add.vue +24 -0
- package/template/meadmin/view/admin/src/views/file/components/info.vue +51 -0
- package/template/meadmin/view/admin/src/views/file/components/up.vue +72 -0
- package/template/meadmin/view/admin/src/views/file/index.vue +132 -0
- package/template/meadmin/view/admin/src/views/file/lang/en.json +11 -0
- package/template/meadmin/view/admin/src/views/login/components/header.vue +20 -0
- package/template/meadmin/view/admin/src/views/login/index.vue +163 -0
- package/template/meadmin/view/admin/src/views/redirect.vue +12 -0
- package/template/meadmin/view/admin/src/views/system/admin/components/addOrUp.vue +111 -0
- package/template/meadmin/view/admin/src/views/system/admin/components/info.vue +75 -0
- package/template/meadmin/view/admin/src/views/system/admin/dict.ts +7 -0
- package/template/meadmin/view/admin/src/views/system/admin/index.vue +145 -0
- package/template/meadmin/view/admin/src/views/system/admin/lang/en.json +19 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/components/addOrUp.vue +145 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/components/info.vue +68 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/dict.ts +36 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/index.vue +162 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/menu/lang/en.json +20 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/components/addOrUp.vue +94 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/components/info.vue +59 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/dict.ts +7 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/index.vue +153 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/components/role/lang/en.json +14 -0
- package/template/meadmin/view/admin/src/views/system/menuRole/index.vue +59 -0
- package/template/meadmin/view/admin/src/views/user/components/addOrUp.vue +120 -0
- package/template/meadmin/view/admin/src/views/user/components/info.vue +56 -0
- package/template/meadmin/view/admin/src/views/user/dict.ts +7 -0
- package/template/meadmin/view/admin/src/views/user/file/components/add.vue +24 -0
- package/template/meadmin/view/admin/src/views/user/file/components/info.vue +54 -0
- package/template/meadmin/view/admin/src/views/user/file/components/up.vue +82 -0
- package/template/meadmin/view/admin/src/views/user/file/index.vue +148 -0
- package/template/meadmin/view/admin/src/views/user/file/lang/en.json +17 -0
- package/template/meadmin/view/admin/src/views/user/index.vue +145 -0
- package/template/meadmin/view/admin/src/views/user/lang/en.json +18 -0
- package/template/meadmin/view/admin/template/components.d.ts +9 -0
- package/template/meadmin/view/admin/template/directives.d.ts +6 -0
- package/template/meadmin/view/admin/template/meIconComponents.d.ts +6 -0
- package/template/meadmin/view/admin/tsconfig.json +33 -0
- package/template/meadmin/view/admin/tsconfig.node.json +17 -0
- package/template/meadmin/view/admin/types/api.d.ts +15 -0
- package/template/meadmin/view/admin/types/auto-imports.d.ts +302 -0
- package/template/meadmin/view/admin/types/global.d.ts +60 -0
- package/template/meadmin/view/admin/types/globalComponents.d.ts +13 -0
- package/template/meadmin/view/admin/types/melIconComponents.d.d.ts +9 -0
- package/template/meadmin/view/admin/types/vue-router.d.ts +39 -0
- package/template/meadmin/view/admin/types/vueCustomProperties .d.ts +6 -0
- package/template/meadmin/view/admin/types/vueExtendType.d.ts +43 -0
- package/template/meadmin/view/admin/vite.config.ts +110 -0
- package/template/meadmin/view/index/.prettierignore +28 -0
- package/template/meadmin/view/index/.prettierrc.cjs +4 -0
- package/template/meadmin/view/index/README.md +84 -0
- package/template/meadmin/view/index/cli/autoImport.ts +3 -0
- package/template/meadmin/view/index/eslint.config.js +91 -0
- package/template/meadmin/view/index/index.html +22 -0
- package/template/meadmin/view/index/packageTemplate.json +122 -0
- package/template/meadmin/view/index/plugins/autoComponents.ts +10 -0
- package/template/meadmin/view/index/plugins/autoImport.ts +64 -0
- package/template/meadmin/view/index/plugins/autoImportApi.ts +14 -0
- package/template/meadmin/view/index/plugins/babel.ts +25 -0
- package/template/meadmin/view/index/plugins/index.ts +103 -0
- package/template/meadmin/view/index/plugins/svgLoader.ts +22 -0
- package/template/meadmin/view/index/plugins/vueSetUpExtend.ts +5 -0
- package/template/meadmin/view/index/public/favicon.ico +0 -0
- package/template/meadmin/view/index/public/logo.png +0 -0
- package/template/meadmin/view/index/public/logo.svg +1 -0
- package/template/meadmin/view/index/src/App.vue +30 -0
- package/template/meadmin/view/index/src/api/api.model.ts +11 -0
- package/template/meadmin/view/index/src/api/file.ts +123 -0
- package/template/meadmin/view/index/src/api/index.ts +25 -0
- package/template/meadmin/view/index/src/api/login.ts +72 -0
- package/template/meadmin/view/index/src/api/user.ts +42 -0
- package/template/meadmin/view/index/src/app.ts +39 -0
- package/template/meadmin/view/index/src/assets/images/404.svg +339 -0
- package/template/meadmin/view/index/src/assets/images/avatar.jpg +0 -0
- package/template/meadmin/view/index/src/components/meButton.vue +34 -0
- package/template/meadmin/view/index/src/components/meDialog/hooks/minMax.ts +166 -0
- package/template/meadmin/view/index/src/components/meDialog/index.vue +86 -0
- package/template/meadmin/view/index/src/components/meNumber.vue +74 -0
- package/template/meadmin/view/index/src/components/meSelectFile/index.vue +92 -0
- package/template/meadmin/view/index/src/components/meSelectFile/meSelectFile.ts +3 -0
- package/template/meadmin/view/index/src/components/meUpAvatar.vue +166 -0
- package/template/meadmin/view/index/src/components/meUpload.vue +111 -0
- package/template/meadmin/view/index/src/components/meVxeTable/components/pagination.vue +67 -0
- package/template/meadmin/view/index/src/components/meVxeTable/directives/resize.ts +31 -0
- package/template/meadmin/view/index/src/components/meVxeTable/index.vue +286 -0
- package/template/meadmin/view/index/src/components/meVxeTable/install.ts +18 -0
- package/template/meadmin/view/index/src/components/meVxeTable/util.ts +11 -0
- package/template/meadmin/view/index/src/components/meWangEditor/index.vue +121 -0
- package/template/meadmin/view/index/src/components/meWangEditor/meWangEditor.scss +24 -0
- package/template/meadmin/view/index/src/components/service/meImageViewer.ts +23 -0
- package/template/meadmin/view/index/src/config/index.ts +2 -0
- package/template/meadmin/view/index/src/config/login.ts +5 -0
- package/template/meadmin/view/index/src/dict/eventEnmu.ts +13 -0
- package/template/meadmin/view/index/src/dict/pageEnum.ts +8 -0
- package/template/meadmin/view/index/src/directives/clickOutside.ts +2 -0
- package/template/meadmin/view/index/src/entry-client.ts +8 -0
- package/template/meadmin/view/index/src/entry-server.ts +83 -0
- package/template/meadmin/view/index/src/env.d.ts +6 -0
- package/template/meadmin/view/index/src/event/index.ts +23 -0
- package/template/meadmin/view/index/src/hooks/actionModel.ts +54 -0
- package/template/meadmin/view/index/src/hooks/core/computedProxy.ts +10 -0
- package/template/meadmin/view/index/src/hooks/index.ts +24 -0
- package/template/meadmin/view/index/src/icons/index.ts +52 -0
- package/template/meadmin/view/index/src/icons/svg/dashboard.svg +5 -0
- package/template/meadmin/view/index/src/icons/svg/moon.svg +5 -0
- package/template/meadmin/view/index/src/icons/svg/size.svg +5 -0
- package/template/meadmin/view/index/src/icons/svg/sunny.svg +5 -0
- package/template/meadmin/view/index/src/icons/svg/translation.svg +5 -0
- package/template/meadmin/view/index/src/layout/default/components/footer.vue +22 -0
- package/template/meadmin/view/index/src/layout/default/components/header/components/menuItem.vue +69 -0
- package/template/meadmin/view/index/src/layout/default/components/header/components/user.vue +55 -0
- package/template/meadmin/view/index/src/layout/default/components/header/index.vue +53 -0
- package/template/meadmin/view/index/src/layout/default/index.vue +63 -0
- package/template/meadmin/view/index/src/layout/default/layout.scss +1 -0
- package/template/meadmin/view/index/src/layout/default/page.vue +11 -0
- package/template/meadmin/view/index/src/layout/layoutRoute.vue +13 -0
- package/template/meadmin/view/index/src/main.ts +28 -0
- package/template/meadmin/view/index/src/router/guard/index.ts +53 -0
- package/template/meadmin/view/index/src/router/index.ts +73 -0
- package/template/meadmin/view/index/src/router/routes/001-index.ts +42 -0
- package/template/meadmin/view/index/src/router/routes/002-demo.ts +12 -0
- package/template/meadmin/view/index/src/router/routes/003-user.ts +27 -0
- package/template/meadmin/view/index/src/router/routes/demo/001-demo.ts +36 -0
- package/template/meadmin/view/index/src/setElGlobel.ts +7 -0
- package/template/meadmin/view/index/src/store/index.ts +11 -0
- package/template/meadmin/view/index/src/store/module.ts +5 -0
- package/template/meadmin/view/index/src/store/modules/global.ts +52 -0
- package/template/meadmin/view/index/src/store/modules/route.ts +20 -0
- package/template/meadmin/view/index/src/store/modules/user.ts +98 -0
- package/template/meadmin/view/index/src/styles/element-plus.scss +40 -0
- package/template/meadmin/view/index/src/styles/index.scss +122 -0
- package/template/meadmin/view/index/src/styles/transition.scss +33 -0
- package/template/meadmin/view/index/src/styles/variables.scss +6 -0
- package/template/meadmin/view/index/src/utils/cookies.ts +59 -0
- package/template/meadmin/view/index/src/utils/fileMd5Work.ts +109 -0
- package/template/meadmin/view/index/src/utils/fileUpload.ts +156 -0
- package/template/meadmin/view/index/src/utils/helper.ts +261 -0
- package/template/meadmin/view/index/src/utils/loading.ts +71 -0
- package/template/meadmin/view/index/src/utils/log.ts +8 -0
- package/template/meadmin/view/index/src/utils/mitt.ts +152 -0
- package/template/meadmin/view/index/src/utils/nProgress.ts +52 -0
- package/template/meadmin/view/index/src/utils/request.ts +182 -0
- package/template/meadmin/view/index/src/utils/server.ts +73 -0
- package/template/meadmin/view/index/src/utils/validate.ts +17 -0
- package/template/meadmin/view/index/src/views/404.vue +50 -0
- package/template/meadmin/view/index/src/views/index/index.vue +137 -0
- package/template/meadmin/view/index/src/views/login/components/login.vue +117 -0
- package/template/meadmin/view/index/src/views/login/components/register.vue +192 -0
- package/template/meadmin/view/index/src/views/login/index.vue +147 -0
- package/template/meadmin/view/index/src/views/promiseError.vue +48 -0
- package/template/meadmin/view/index/src/views/redirect.vue +9 -0
- package/template/meadmin/view/index/src/views/user/components/editPass.vue +83 -0
- package/template/meadmin/view/index/src/views/user/components/userInfo.vue +91 -0
- package/template/meadmin/view/index/src/views/user/index.vue +67 -0
- package/template/meadmin/view/index/template/components.d.ts +9 -0
- package/template/meadmin/view/index/template/directives.d.ts +6 -0
- package/template/meadmin/view/index/template/meIconComponents.d.ts +6 -0
- package/template/meadmin/view/index/tsconfig.json +33 -0
- package/template/meadmin/view/index/tsconfig.node.json +17 -0
- package/template/meadmin/view/index/types/api.d.ts +15 -0
- package/template/meadmin/view/index/types/auto-imports.d.ts +301 -0
- package/template/meadmin/view/index/types/components.d.ts +25 -0
- package/template/meadmin/view/index/types/directives.d.ts +7 -0
- package/template/meadmin/view/index/types/global.d.ts +51 -0
- package/template/meadmin/view/index/types/globalComponents.d.ts +14 -0
- package/template/meadmin/view/index/types/meIconComponents.d.ts +11 -0
- package/template/meadmin/view/index/types/vue-router.d.ts +17 -0
- package/template/meadmin/view/index/types/vueCustomProperties .d.ts +6 -0
- package/template/meadmin/view/index/types/vueExtendType.d.ts +43 -0
- package/template/meadmin/view/index/vite.config.ts +92 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import vue from '@vitejs/plugin-vue';
|
|
2
|
+
import { visualizer } from 'rollup-plugin-visualizer'; //打包大小分析(stats.html)
|
|
3
|
+
import { ConfigEnv } from 'vite';
|
|
4
|
+
import autoComponents from './autoComponents.js';
|
|
5
|
+
import autoImport from './autoImport.js';
|
|
6
|
+
import autoImportApi from './autoImportApi.js';
|
|
7
|
+
import babel from './babel.js';
|
|
8
|
+
import svgLoader from './svgLoader.js';
|
|
9
|
+
import vueSetUpExtend from './vueSetUpExtend.js';
|
|
10
|
+
// import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
|
11
|
+
// import { splitVendorChunkPlugin } from 'vite';
|
|
12
|
+
import { compression } from 'vite-plugin-compression2'; //压缩gz和br
|
|
13
|
+
|
|
14
|
+
const virtualFile = '@virtual-file';
|
|
15
|
+
const virtualId = '\0' + virtualFile;
|
|
16
|
+
const nestedVirtualFile = '@nested-virtual-file';
|
|
17
|
+
const nestedVirtualId = '\0' + nestedVirtualFile;
|
|
18
|
+
export default (configEnv: ConfigEnv) => {
|
|
19
|
+
return [
|
|
20
|
+
vue(),
|
|
21
|
+
// splitVendorChunkPlugin(), //打包分析,会生成stats.html展示打包情况
|
|
22
|
+
visualizer(),
|
|
23
|
+
compression(),
|
|
24
|
+
autoComponents(),
|
|
25
|
+
autoImport(),
|
|
26
|
+
autoImportApi(),
|
|
27
|
+
babel(),
|
|
28
|
+
svgLoader(),
|
|
29
|
+
vueSetUpExtend(),
|
|
30
|
+
//ssr需求插件
|
|
31
|
+
{
|
|
32
|
+
name: 'virtual',
|
|
33
|
+
resolveId(id: string) {
|
|
34
|
+
if (id === '@foo') {
|
|
35
|
+
return id;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
load(id: string, options?: { ssr?: boolean }) {
|
|
39
|
+
const ssrFromOptions = options?.ssr ?? false;
|
|
40
|
+
if (id === '@foo') {
|
|
41
|
+
// Force a mismatch error if ssrBuild is different from ssrFromOptions 如果 ssrBuild 与 ssrFromOptions 不同,则强制出现不匹配错误
|
|
42
|
+
return `export default { msg: '${configEnv.command === 'build' && !!configEnv.isSsrBuild !== ssrFromOptions ? 'defineConfig ssrBuild !== ssr from load options' : 'hi'}' }`;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'virtual-module',
|
|
48
|
+
resolveId(id: string) {
|
|
49
|
+
if (id === virtualFile) {
|
|
50
|
+
return virtualId;
|
|
51
|
+
} else if (id === nestedVirtualFile) {
|
|
52
|
+
return nestedVirtualId;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
load(id: string) {
|
|
56
|
+
if (id === virtualId) {
|
|
57
|
+
return 'export { msg } from "@nested-virtual-file";';
|
|
58
|
+
} else if (id === nestedVirtualId) {
|
|
59
|
+
return 'export const msg = "[success] from conventional virtual file"';
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
// Example of a plugin that injects a helper from a virtual module that can
|
|
64
|
+
// be used in renderBuiltUrl 从虚拟模块注入辅助函数的插件示例,该模块可在 renderBuiltUrl 中使用
|
|
65
|
+
(function () {
|
|
66
|
+
const queryRE = /\?.*$/s;
|
|
67
|
+
const hashRE = /#.*$/s;
|
|
68
|
+
const cleanUrl = (url: string) => url.replace(hashRE, '').replace(queryRE, '');
|
|
69
|
+
let config: { base: any; build: { ssr: any } };
|
|
70
|
+
|
|
71
|
+
const virtualId = '\0virtual:ssr-vue-built-url';
|
|
72
|
+
return {
|
|
73
|
+
name: 'built-url',
|
|
74
|
+
enforce: 'post' as const,
|
|
75
|
+
configResolved(_config: { base: any; build: { ssr: any } }) {
|
|
76
|
+
config = _config;
|
|
77
|
+
},
|
|
78
|
+
resolveId(id: string) {
|
|
79
|
+
if (id === virtualId) {
|
|
80
|
+
return id;
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
load(id: string) {
|
|
84
|
+
if (id === virtualId) {
|
|
85
|
+
return {
|
|
86
|
+
code: `export const __ssr_vue_processAssetPath = (url) => '${config.base}' + url`,
|
|
87
|
+
moduleSideEffects: 'no-treeshake' as const,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
transform(code: string | string[], id: string) {
|
|
92
|
+
const cleanId = cleanUrl(id);
|
|
93
|
+
if (config.build.ssr && (cleanId.endsWith('.js') || cleanId.endsWith('.vue')) && !code.includes('__ssr_vue_processAssetPath')) {
|
|
94
|
+
return {
|
|
95
|
+
code: `import { __ssr_vue_processAssetPath } from '${virtualId}';__ssr_vue_processAssetPath;` + code,
|
|
96
|
+
sourcemap: null, // no sourcemap support to speed up CI
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
})(),
|
|
102
|
+
];
|
|
103
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import svgLoader from 'vite-svg-loader';
|
|
2
|
+
export default () =>
|
|
3
|
+
svgLoader({
|
|
4
|
+
svgoConfig: {
|
|
5
|
+
plugins: [
|
|
6
|
+
{
|
|
7
|
+
name: 'preset-default',
|
|
8
|
+
params: {
|
|
9
|
+
overrides: {
|
|
10
|
+
removeViewBox: false, // 禁用插件
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'removeAttrs',
|
|
16
|
+
params: {
|
|
17
|
+
attrs: '(width|height|fill)', // 清除svg属性
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
});
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><filter id="prefix__b" x="-100%" y="-100%" width="400%" height="400%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="17 8" x="0%" y="0%" in="SourceGraphic" result="blur"/></filter><filter id="prefix__c" x="-100%" y="-100%" width="400%" height="400%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="10 17" x="0%" y="0%" in="SourceGraphic" result="blur"/></filter><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="prefix__a"><stop stop-color="hsl(162, 100%, 58%)" offset="0%"/><stop stop-color="hsl(270, 73%, 53%)" offset="100%"/></linearGradient></defs><g stroke-width="16" stroke="url(#prefix__a)" fill="none"><path filter="url(#prefix__b)" d="M400 50L50 750h700z"/><path filter="url(#prefix__c)" opacity=".25" d="M412 50L62 750h700z"/><path filter="url(#prefix__c)" opacity=".25" d="M388 50L38 750h700z"/><path d="M400 50L50 750h700z"/></g></svg>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-config-provider :value-on-clear="() => null">
|
|
3
|
+
<router-view v-slot="{ Component }">
|
|
4
|
+
<Suspense @resolve="done()" @pending="set(1)">
|
|
5
|
+
<component :is="Component"></component>
|
|
6
|
+
</Suspense>
|
|
7
|
+
</router-view>
|
|
8
|
+
<Teleport to="body">
|
|
9
|
+
<Suspense>
|
|
10
|
+
<component :is="item.component" v-for="item in globalComponents" :key="item.key" :ref="(vnode:any)=>item.vnode = vnode" v-bind="item.props"></component>
|
|
11
|
+
</Suspense>
|
|
12
|
+
</Teleport>
|
|
13
|
+
</el-config-provider>
|
|
14
|
+
</template>
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { useGlobalStore } from '@/store';
|
|
17
|
+
import { done, set } from '@/utils/nProgress';
|
|
18
|
+
const { globalComponents } = toRefs(useGlobalStore());
|
|
19
|
+
</script>
|
|
20
|
+
<style lang="scss" scoped>
|
|
21
|
+
.fade-enter-active,
|
|
22
|
+
.fade-leave-active {
|
|
23
|
+
transition: opacity 0.5s ease;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.fade-enter-from,
|
|
27
|
+
.fade-leave-to {
|
|
28
|
+
opacity: 0;
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { PageParam, PageResult } from '@/api/api.model.js';
|
|
2
|
+
import request, { RequestOptions } from '@/utils/request.js';
|
|
3
|
+
import { UserInfo } from './user.js';
|
|
4
|
+
|
|
5
|
+
//附件
|
|
6
|
+
export class File {
|
|
7
|
+
id?: string; //ID
|
|
8
|
+
name = '' as string; //文件名
|
|
9
|
+
path = '' as string; //路径
|
|
10
|
+
mimeType = '' as string; //mime类型
|
|
11
|
+
size = undefined as number | null | undefined; //文件大小(字节)
|
|
12
|
+
storage = '' as string; //存储引擎
|
|
13
|
+
url = ''; //访问地址
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type FileInfo = Required<File> & {
|
|
17
|
+
id: string; //ID
|
|
18
|
+
createdUser: NonNullable<Omit<UserInfo, 'avatar'>>;
|
|
19
|
+
size: number;
|
|
20
|
+
createdAt: string; //创建时间
|
|
21
|
+
updatedA: string; //最后更新时间
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 上传文件
|
|
26
|
+
* FormData参数说明
|
|
27
|
+
* file File 文件
|
|
28
|
+
* md5 string md5值
|
|
29
|
+
* sharding '0'|'1' 分片上传:0=否;1=是
|
|
30
|
+
* chunkMd5 string 当前分片md5值
|
|
31
|
+
* chunkIndex string 当前片序号(从0开始)
|
|
32
|
+
* start string 当前分片起止位置(从0开始)
|
|
33
|
+
* over string 是否结束(需确保最后一个分片上传时其他分片请求已完成):0=否;1=是
|
|
34
|
+
*
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export function uploadFileApi<T extends boolean = true>(returnAxios = true as T) {
|
|
38
|
+
return request<Partial<FileInfo>, [FormData], T>(
|
|
39
|
+
(data) => ({
|
|
40
|
+
url: 'file/upload',
|
|
41
|
+
method: 'post',
|
|
42
|
+
data: data,
|
|
43
|
+
headers: {
|
|
44
|
+
'Content-Type': 'multipart/form-data',
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
{ success: false, noLoading: true },
|
|
48
|
+
returnAxios,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type FileListResult = PageResult<FileInfo>;
|
|
53
|
+
export class FileListParam extends PageParam {
|
|
54
|
+
id?: string; //ID
|
|
55
|
+
filename?: string; //文件名
|
|
56
|
+
path?: string; //路径
|
|
57
|
+
mimeType?: string; //mime类型
|
|
58
|
+
size?: number | null; //文件大小(字节)
|
|
59
|
+
storage?: string; //存储引擎
|
|
60
|
+
startCreatedAt?: string; //创建时间(起)
|
|
61
|
+
endCreatedAt?: string; //创建时间(止)
|
|
62
|
+
startUpdatedAt?: string; //最后更新时间(起)
|
|
63
|
+
endUpdatedAt?: string; //最后更新时间(止)
|
|
64
|
+
createdUserId?: string; //创建者id
|
|
65
|
+
}
|
|
66
|
+
//获取附件列表
|
|
67
|
+
export function fileListApi(options?: RequestOptions<FileListResult, [FileListParam]>) {
|
|
68
|
+
return request<FileListResult, [FileListParam]>(
|
|
69
|
+
(data) => ({
|
|
70
|
+
url: 'file/',
|
|
71
|
+
method: 'post',
|
|
72
|
+
data: data,
|
|
73
|
+
}),
|
|
74
|
+
Object.assign({ noLoading: true, clearEmpty: ['', undefined, null] }, options),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//获取我的附件列表
|
|
79
|
+
export function fileMyListApi(options?: RequestOptions<FileListResult, [Omit<FileListParam, 'createdUserId'>]>) {
|
|
80
|
+
return request<FileListResult, [Omit<FileListParam, 'createdUserId'>]>(
|
|
81
|
+
(data) => ({
|
|
82
|
+
url: 'file/my',
|
|
83
|
+
method: 'post',
|
|
84
|
+
data: data,
|
|
85
|
+
}),
|
|
86
|
+
Object.assign({ noLoading: true, clearEmpty: ['', undefined, null] }, options),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//根据id获取附件详情
|
|
91
|
+
export function fileInfoApi(options?: RequestOptions<FileInfo, [string]>) {
|
|
92
|
+
return request<FileInfo, [string]>(
|
|
93
|
+
(id) => ({
|
|
94
|
+
url: `file/info/${id}`,
|
|
95
|
+
method: 'get',
|
|
96
|
+
}),
|
|
97
|
+
options,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type UpdateFileInfoParam = Omit<Partial<FileInfo>, 'id' | 'createdAt' | 'updatedAt' | 'createdUser'>;
|
|
102
|
+
//修改附件信息
|
|
103
|
+
export function updateFileApi(options?: RequestOptions<FileInfo, [string, UpdateFileInfoParam]>) {
|
|
104
|
+
return request<FileInfo, [string, UpdateFileInfoParam]>(
|
|
105
|
+
(id, data) => ({
|
|
106
|
+
url: `file/up/${id}`,
|
|
107
|
+
method: 'post',
|
|
108
|
+
data: data,
|
|
109
|
+
}),
|
|
110
|
+
Object.assign({ success: true, noLoading: true }, options),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
//删除附件
|
|
115
|
+
export function delFileApi(options?: RequestOptions<null, [string]>) {
|
|
116
|
+
return request<null, [string]>(
|
|
117
|
+
(id) => ({
|
|
118
|
+
url: `file/del/${id}`,
|
|
119
|
+
method: 'post',
|
|
120
|
+
}),
|
|
121
|
+
Object.assign({ noLoading: true }, options),
|
|
122
|
+
);
|
|
123
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import request, { RequestOptions } from '@/utils/request';
|
|
2
|
+
export type IndexResult = {
|
|
3
|
+
banner: {
|
|
4
|
+
title: string;
|
|
5
|
+
content: string;
|
|
6
|
+
bgImg: string;
|
|
7
|
+
}[];
|
|
8
|
+
info: {
|
|
9
|
+
title: string;
|
|
10
|
+
desc: string;
|
|
11
|
+
list: {
|
|
12
|
+
title: string;
|
|
13
|
+
content: string;
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export function indexApi(options?: RequestOptions<IndexResult, []>) {
|
|
18
|
+
return request<IndexResult, []>(
|
|
19
|
+
() => ({
|
|
20
|
+
url: 'index',
|
|
21
|
+
method: 'get',
|
|
22
|
+
}),
|
|
23
|
+
options,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import request, { RequestOptions } from '@/utils/request';
|
|
2
|
+
import { App } from 'vue';
|
|
3
|
+
import { FileInfo } from './file.js';
|
|
4
|
+
import { UserInfo } from './user.js';
|
|
5
|
+
//获取登录验证码
|
|
6
|
+
export function loginCaptchaApi<T extends boolean = false>(returnAxios: T = false as T, noLoading = true) {
|
|
7
|
+
return request<{ id: string; imageBase64: string }, [number?, number?], T>(
|
|
8
|
+
(width = 100, height = 30) => ({
|
|
9
|
+
url: 'login/captcha',
|
|
10
|
+
method: 'get',
|
|
11
|
+
params: { width, height },
|
|
12
|
+
}),
|
|
13
|
+
{ noLoading },
|
|
14
|
+
returnAxios,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// 登录
|
|
19
|
+
export class LoginParams {
|
|
20
|
+
username = '';
|
|
21
|
+
password = '';
|
|
22
|
+
captcha = '';
|
|
23
|
+
captchaId = '';
|
|
24
|
+
}
|
|
25
|
+
export interface LoginResult {
|
|
26
|
+
token: string;
|
|
27
|
+
}
|
|
28
|
+
export function loginApi<T extends boolean = true>(returnAxios: T = true as T, app?: App) {
|
|
29
|
+
return request<LoginResult, [LoginParams], T>(
|
|
30
|
+
(params) => ({
|
|
31
|
+
url: 'login/login',
|
|
32
|
+
method: 'post',
|
|
33
|
+
data: params,
|
|
34
|
+
}),
|
|
35
|
+
{},
|
|
36
|
+
returnAxios,
|
|
37
|
+
app,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//获取用户详情
|
|
42
|
+
export function userInfoApi<T extends boolean = false>(returnAxios: T = false as T, noLoading = true, app?: App) {
|
|
43
|
+
return request<UserInfo, [], T>(
|
|
44
|
+
() => ({
|
|
45
|
+
url: 'login/info',
|
|
46
|
+
method: 'post',
|
|
47
|
+
}),
|
|
48
|
+
{ noLoading },
|
|
49
|
+
returnAxios,
|
|
50
|
+
app,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class RegisterParams {
|
|
55
|
+
username = '';
|
|
56
|
+
nickname = '';
|
|
57
|
+
password = '';
|
|
58
|
+
reqPassword = '';
|
|
59
|
+
avatar = undefined as FileInfo | undefined | null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//注册
|
|
63
|
+
export function registerApi(options: RequestOptions<UserInfo, [RegisterParams]> = { success: true }) {
|
|
64
|
+
return request<UserInfo, [RegisterParams]>(
|
|
65
|
+
(data) => ({
|
|
66
|
+
url: 'login/register',
|
|
67
|
+
method: 'post',
|
|
68
|
+
data,
|
|
69
|
+
}),
|
|
70
|
+
options,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import request, { RequestOptions } from '@/utils/request.js';
|
|
2
|
+
import { FileInfo } from './file.js';
|
|
3
|
+
|
|
4
|
+
export type UserInfo = {
|
|
5
|
+
id: string; //ID
|
|
6
|
+
username: string; //用户名
|
|
7
|
+
nickname: string; //昵称
|
|
8
|
+
avatar: FileInfo | null | undefined; //头像
|
|
9
|
+
email: string | null; //邮箱
|
|
10
|
+
mobile: string | null; //手机号
|
|
11
|
+
password: string; //密码
|
|
12
|
+
status: 1 | 0; //状态:1=启用;0=禁用
|
|
13
|
+
lastLoginAt: string | null; //最后登录时间
|
|
14
|
+
lastLoginIp: string; //最后登录ip
|
|
15
|
+
loginFailure: number | undefined; //登录失败次数
|
|
16
|
+
createdAt: string; //创建时间
|
|
17
|
+
updatedAt: string; //最后更新时间
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//获取当前用户详情
|
|
21
|
+
export function userInfoApi(options?: RequestOptions<UserInfo, []>) {
|
|
22
|
+
return request<UserInfo, []>(
|
|
23
|
+
() => ({
|
|
24
|
+
url: `user/info`,
|
|
25
|
+
method: 'get',
|
|
26
|
+
}),
|
|
27
|
+
options,
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type UpdateUserInfoParam = Omit<Partial<UserInfo>, 'id' | 'createdAt' | 'updatedAt' | 'status' | 'lastLoginAt' | 'lastLoginIp' | 'loginFailure'> & { orgPassword?: string };
|
|
32
|
+
//修改当前用户信息
|
|
33
|
+
export function updateUserApi(options?: RequestOptions<UserInfo, [UpdateUserInfoParam]>) {
|
|
34
|
+
return request<UserInfo, [UpdateUserInfoParam]>(
|
|
35
|
+
(data) => ({
|
|
36
|
+
url: `user/up`,
|
|
37
|
+
method: 'post',
|
|
38
|
+
data: data,
|
|
39
|
+
}),
|
|
40
|
+
Object.assign({ success: true, noLoading: true }, options),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import '@/styles/index.scss';
|
|
2
|
+
import nProgress from 'nprogress';
|
|
3
|
+
import { App } from 'vue';
|
|
4
|
+
import { initVxeTable } from './components/meVxeTable/install.js';
|
|
5
|
+
import { event, mitter } from './event';
|
|
6
|
+
import { installIcon } from './icons/index.js';
|
|
7
|
+
import { setupRouterGuard } from './router/guard/index.js';
|
|
8
|
+
import { installRoute } from './router/index.js';
|
|
9
|
+
import { installStore } from './store/index.js';
|
|
10
|
+
export const ssrVersionKey = Symbol('ssrVersionKey');
|
|
11
|
+
export async function bootscrapt(app: App, ssrVersion: string = '') {
|
|
12
|
+
app.config.globalProperties.$start = true;
|
|
13
|
+
if (import.meta.env.SSR) {
|
|
14
|
+
app.config.globalProperties.$ssrVersion = ssrVersion;
|
|
15
|
+
} else {
|
|
16
|
+
app.config.globalProperties.$ssrVersion = window.__ssrVersion ?? '';
|
|
17
|
+
}
|
|
18
|
+
app.provide(ssrVersionKey, app.config.globalProperties.$ssrVersion);
|
|
19
|
+
const router = installRoute();
|
|
20
|
+
app.config.globalProperties.$router = router;
|
|
21
|
+
const store = await installStore(app);
|
|
22
|
+
app.use(router);
|
|
23
|
+
setupRouterGuard(router, store);
|
|
24
|
+
initVxeTable(app);
|
|
25
|
+
installIcon(app);
|
|
26
|
+
if (!import.meta.env.SSR) {
|
|
27
|
+
window.addEventListener('resize', () => mitter.emit(event.RESIZE));
|
|
28
|
+
// 进度条配置
|
|
29
|
+
nProgress.configure({
|
|
30
|
+
showSpinner: false,
|
|
31
|
+
});
|
|
32
|
+
if (window.__pinia) {
|
|
33
|
+
store.state.value = window.__pinia;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
await Promise.allSettled(mitter.emit(event.START, app));
|
|
37
|
+
mitter.emit(event.READY, app);
|
|
38
|
+
return { router, store, app };
|
|
39
|
+
}
|