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,189 @@
|
|
|
1
|
+
import { PageParam, PageResult } from '@/api/api.model.js';
|
|
2
|
+
import { FileInfo } from '@/api/file.js';
|
|
3
|
+
import { SystemAdminInfo } from '@/api/system/admin.js';
|
|
4
|
+
import request, { RequestOptions } from '@/utils/request.js';
|
|
5
|
+
|
|
6
|
+
//示例_Demo
|
|
7
|
+
export class ExampleDemo {
|
|
8
|
+
mobile = '' as string | null; //手机号
|
|
9
|
+
type = undefined as 0 | 1 | 2 | undefined; //类型:0=书籍;1=电子产品;2=卡片
|
|
10
|
+
name = '' as string; //名称
|
|
11
|
+
books = [] as Array<ExampleBook>; //书籍
|
|
12
|
+
user = undefined as User | null | undefined; //用户
|
|
13
|
+
avatar = undefined as FileInfo | null | undefined; //头像
|
|
14
|
+
files = [] as Array<FileInfo>; //附件
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//示例_书籍
|
|
18
|
+
export type ExampleBook = {
|
|
19
|
+
createdAdmin: SystemAdminInfo | null; //创建者
|
|
20
|
+
updatedAdmin: SystemAdminInfo | null; //最后更新者
|
|
21
|
+
id: string; //ID
|
|
22
|
+
name: string; //名称
|
|
23
|
+
createdAt: string; //创建时间
|
|
24
|
+
updatedAt: string; //最后更新时间
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//用户
|
|
28
|
+
export type User = {
|
|
29
|
+
id: string; //ID
|
|
30
|
+
username: string; //用户名
|
|
31
|
+
nickname: string; //昵称
|
|
32
|
+
password: string; //密码
|
|
33
|
+
avatar: UserFile | null; //头像
|
|
34
|
+
email: string | null; //邮箱
|
|
35
|
+
mobile: string | null; //手机号
|
|
36
|
+
loginFailure: number; //登录失败次数
|
|
37
|
+
lastLoginAt: string | null; //最后登录时间
|
|
38
|
+
lastLoginIp: string; //最后登录ip
|
|
39
|
+
status: 1 | 0; //状态:1=启用;0=禁用
|
|
40
|
+
createdUserId: string | null; //创建者Id
|
|
41
|
+
createdUser: User | null; //创建者
|
|
42
|
+
updatedUser: User | null; //最后更新者
|
|
43
|
+
createdAt: string; //创建时间
|
|
44
|
+
updatedAt: string; //最后更新时间
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//用户附件表(前台)
|
|
48
|
+
export type UserFile = {
|
|
49
|
+
createdUserId: string | null; //创建者Id
|
|
50
|
+
createdUser: User | null; //创建者
|
|
51
|
+
updatedUser: User | null; //最后更新者
|
|
52
|
+
id: string; //ID
|
|
53
|
+
name: string; //文件名
|
|
54
|
+
path: string; //路径
|
|
55
|
+
mimeType: string; //mime类型
|
|
56
|
+
size: number | null; //文件大小
|
|
57
|
+
storage: string; //存储引擎
|
|
58
|
+
md5: string; //文件MD5值
|
|
59
|
+
url: string | null; //文件url
|
|
60
|
+
createdAt: string; //创建时间
|
|
61
|
+
updatedAt: string; //最后更新时间
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
//获取用户信息
|
|
65
|
+
export function getUserApi() {
|
|
66
|
+
return request<
|
|
67
|
+
PageResult<User>,
|
|
68
|
+
[
|
|
69
|
+
{
|
|
70
|
+
id?: string;
|
|
71
|
+
username?: string;
|
|
72
|
+
page: number;
|
|
73
|
+
pageSize: number;
|
|
74
|
+
},
|
|
75
|
+
]
|
|
76
|
+
>(
|
|
77
|
+
(data) => ({
|
|
78
|
+
url: 'example/demo/getUser',
|
|
79
|
+
method: 'post',
|
|
80
|
+
data: data,
|
|
81
|
+
}),
|
|
82
|
+
{ noLoading: true },
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//获取示例_书籍信息
|
|
87
|
+
export function getExampleBookApi() {
|
|
88
|
+
return request<
|
|
89
|
+
PageResult<ExampleBook>,
|
|
90
|
+
[
|
|
91
|
+
{
|
|
92
|
+
id?: string;
|
|
93
|
+
name?: string;
|
|
94
|
+
page: number;
|
|
95
|
+
pageSize: number;
|
|
96
|
+
},
|
|
97
|
+
]
|
|
98
|
+
>(
|
|
99
|
+
(data) => ({
|
|
100
|
+
url: 'example/demo/getExampleBook',
|
|
101
|
+
method: 'post',
|
|
102
|
+
data: data,
|
|
103
|
+
}),
|
|
104
|
+
{ noLoading: true },
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type ExampleDemoInfo = ExampleDemo & {
|
|
109
|
+
id: string; //ID
|
|
110
|
+
createdAt: string; //创建时间
|
|
111
|
+
updatedAt: string; //最后更新时间
|
|
112
|
+
createdAdmin: SystemAdminInfo | null; //创建者
|
|
113
|
+
updatedAdmin: SystemAdminInfo | null; //最后更新者
|
|
114
|
+
};
|
|
115
|
+
//添加示例_Demo信息
|
|
116
|
+
export function addExampleDemoApi() {
|
|
117
|
+
return request<ExampleDemoInfo, [ExampleDemo]>(
|
|
118
|
+
(data) => ({
|
|
119
|
+
url: 'example/demo/add',
|
|
120
|
+
method: 'post',
|
|
121
|
+
data: data,
|
|
122
|
+
}),
|
|
123
|
+
{ success: true },
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type ExampleDemoListResult = PageResult<ExampleDemoInfo>;
|
|
128
|
+
export class ExampleDemoListParam extends PageParam {
|
|
129
|
+
createdAdmin?: SystemAdminInfo | null; //创建者
|
|
130
|
+
updatedAdmin?: SystemAdminInfo | null; //最后更新者
|
|
131
|
+
id?: string; //ID
|
|
132
|
+
mobile?: string | null; //手机号
|
|
133
|
+
type?: 0 | 1 | 2; //类型:0=书籍;1=电子产品;2=卡片
|
|
134
|
+
name?: string; //名称
|
|
135
|
+
books?: Array<ExampleBook>; //书籍
|
|
136
|
+
user?: User | null; //用户
|
|
137
|
+
avatar?: FileInfo | null; //头像
|
|
138
|
+
files?: Array<FileInfo>; //附件
|
|
139
|
+
startCreatedAt?: string; //创建时间(起)
|
|
140
|
+
endCreatedAt?: string; //创建时间(止)
|
|
141
|
+
startUpdatedAt?: string; //最后更新时间(起)
|
|
142
|
+
endUpdatedAt?: string; //最后更新时间(止)
|
|
143
|
+
}
|
|
144
|
+
//获取示例_Demo列表
|
|
145
|
+
export function exampleDemoListApi(options?: RequestOptions<ExampleDemoListResult, [ExampleDemoListParam]>) {
|
|
146
|
+
return request<ExampleDemoListResult, [ExampleDemoListParam]>(
|
|
147
|
+
(data) => ({
|
|
148
|
+
url: 'example/demo/',
|
|
149
|
+
method: 'post',
|
|
150
|
+
data: data,
|
|
151
|
+
}),
|
|
152
|
+
Object.assign({ noLoading: true, clearEmpty: ['', undefined, null] }, options),
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
//根据id获取示例_Demo详情
|
|
157
|
+
export function exampleDemoInfoApi(options?: RequestOptions<ExampleDemoInfo, [string]>) {
|
|
158
|
+
return request<ExampleDemoInfo, [string]>(
|
|
159
|
+
(id) => ({
|
|
160
|
+
url: `example/demo/info/${id}`,
|
|
161
|
+
method: 'get',
|
|
162
|
+
}),
|
|
163
|
+
Object.assign({ noLoading: true }, options),
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export type UpdateExampleDemoInfoParam = Omit<Partial<ExampleDemoInfo>, 'id' | 'createdAt' | 'updatedAt' | 'createdAdmin' | 'updatedAdmin'>;
|
|
168
|
+
//修改示例_Demo信息
|
|
169
|
+
export function updateExampleDemoApi(options?: RequestOptions<ExampleDemoInfo, [string, UpdateExampleDemoInfoParam]>) {
|
|
170
|
+
return request<ExampleDemoInfo, [string, UpdateExampleDemoInfoParam]>(
|
|
171
|
+
(id, data) => ({
|
|
172
|
+
url: `example/demo/up/${id}`,
|
|
173
|
+
method: 'post',
|
|
174
|
+
data: data,
|
|
175
|
+
}),
|
|
176
|
+
Object.assign({ success: true, noLoading: true }, options),
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
//删除示例_Demo
|
|
181
|
+
export function delExampleDemoApi(options?: RequestOptions<null, [string]>) {
|
|
182
|
+
return request<null, [string]>(
|
|
183
|
+
(id) => ({
|
|
184
|
+
url: `example/demo/del/${id}`,
|
|
185
|
+
method: 'post',
|
|
186
|
+
}),
|
|
187
|
+
Object.assign({ noLoading: true }, options),
|
|
188
|
+
);
|
|
189
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { PageParam, PageResult } from '@/api/api.model.js';
|
|
2
|
+
import request, { RequestOptions } from '@/utils/request.js';
|
|
3
|
+
import { SystemAdminInfo } from './system/admin.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
|
+
createdAdmin: Omit<SystemAdminInfo, 'roles' | 'roleMenus'>;
|
|
19
|
+
updatedAdmin: Omit<SystemAdminInfo, 'roles' | 'roleMenus'>;
|
|
20
|
+
size: number;
|
|
21
|
+
createdAt: string; //创建时间
|
|
22
|
+
updatedAt: string; //最后更新时间
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 上传文件
|
|
27
|
+
* FormData参数说明
|
|
28
|
+
* file File 文件
|
|
29
|
+
* md5 string md5值
|
|
30
|
+
* sharding '0'|'1' 分片上传:0=否;1=是
|
|
31
|
+
* chunkMd5 string 当前分片md5值
|
|
32
|
+
* chunkIndex string 当前片序号(从0开始)
|
|
33
|
+
* start string 当前分片起止位置(从0开始)
|
|
34
|
+
* over string 是否结束(需确保最后一个分片上传时其他分片请求已完成):0=否;1=是
|
|
35
|
+
*
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
export function uploadFileApi<T extends boolean = true>(returnAxios = true as T) {
|
|
39
|
+
return request<Partial<FileInfo>, [FormData], T>(
|
|
40
|
+
(data) => ({
|
|
41
|
+
url: 'file/upload',
|
|
42
|
+
method: 'post',
|
|
43
|
+
data: data,
|
|
44
|
+
headers: {
|
|
45
|
+
'Content-Type': 'multipart/form-data',
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
{ success: false, noLoading: true },
|
|
49
|
+
returnAxios,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type FileListResult = PageResult<FileInfo>;
|
|
54
|
+
export class FileListParam extends PageParam {
|
|
55
|
+
id?: string; //ID
|
|
56
|
+
name?: string; //文件名
|
|
57
|
+
path?: string; //路径
|
|
58
|
+
mimeType?: string; //mime类型
|
|
59
|
+
size?: number | null; //文件大小(字节)
|
|
60
|
+
storage?: string; //存储引擎
|
|
61
|
+
startCreatedAt?: string; //创建时间(起)
|
|
62
|
+
endCreatedAt?: string; //创建时间(止)
|
|
63
|
+
startUpdatedAt?: string; //最后更新时间(起)
|
|
64
|
+
endUpdatedAt?: string; //最后更新时间(止)
|
|
65
|
+
createdAdminId?: string; //创建者id
|
|
66
|
+
}
|
|
67
|
+
//获取附件列表
|
|
68
|
+
export function fileListApi(options?: RequestOptions<FileListResult, [FileListParam]>) {
|
|
69
|
+
return request<FileListResult, [FileListParam]>(
|
|
70
|
+
(data) => ({
|
|
71
|
+
url: 'file/',
|
|
72
|
+
method: 'post',
|
|
73
|
+
data: data,
|
|
74
|
+
}),
|
|
75
|
+
Object.assign({ noLoading: true, clearEmpty: ['', undefined, null] }, options),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
//获取我的附件列表
|
|
80
|
+
export function fileMyListApi(options?: RequestOptions<FileListResult, [Omit<FileListParam, 'createdAdminId'>]>) {
|
|
81
|
+
return request<FileListResult, [Omit<FileListParam, 'createdAdminId'>]>(
|
|
82
|
+
(data) => ({
|
|
83
|
+
url: 'file/my',
|
|
84
|
+
method: 'post',
|
|
85
|
+
data: data,
|
|
86
|
+
}),
|
|
87
|
+
Object.assign({ noLoading: true, clearEmpty: ['', undefined, null] }, options),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
//根据id获取附件详情
|
|
92
|
+
export function fileInfoApi(options?: RequestOptions<FileInfo, [string]>) {
|
|
93
|
+
return request<FileInfo, [string]>(
|
|
94
|
+
(id) => ({
|
|
95
|
+
url: `file/info/${id}`,
|
|
96
|
+
method: 'get',
|
|
97
|
+
}),
|
|
98
|
+
options,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type UpdateFileInfoParam = Omit<Partial<FileInfo>, 'id' | 'createdAt' | 'updatedAt' | 'createdAdmin'>;
|
|
103
|
+
//修改附件信息
|
|
104
|
+
export function updateFileApi(options?: RequestOptions<FileInfo, [string, UpdateFileInfoParam]>) {
|
|
105
|
+
return request<FileInfo, [string, UpdateFileInfoParam]>(
|
|
106
|
+
(id, data) => ({
|
|
107
|
+
url: `file/up/${id}`,
|
|
108
|
+
method: 'post',
|
|
109
|
+
data: data,
|
|
110
|
+
}),
|
|
111
|
+
Object.assign({ success: true, noLoading: true }, options),
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
//删除附件
|
|
116
|
+
export function delFileApi(options?: RequestOptions<null, [string]>) {
|
|
117
|
+
return request<null, [string]>(
|
|
118
|
+
(id) => ({
|
|
119
|
+
url: `file/del/${id}`,
|
|
120
|
+
method: 'post',
|
|
121
|
+
}),
|
|
122
|
+
Object.assign({ noLoading: true }, options),
|
|
123
|
+
);
|
|
124
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import request from '@/utils/request';
|
|
2
|
+
import { SystemAdminInfo } from './system/admin.js';
|
|
3
|
+
import { SystemMenuInfo } from './system/menu.js';
|
|
4
|
+
|
|
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) {
|
|
29
|
+
return request<LoginResult, [LoginParams], T>(
|
|
30
|
+
(params) => ({
|
|
31
|
+
url: 'login/login',
|
|
32
|
+
method: 'post',
|
|
33
|
+
data: params,
|
|
34
|
+
}),
|
|
35
|
+
{},
|
|
36
|
+
returnAxios,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 获取用户详细信息
|
|
41
|
+
export interface UserInfo {
|
|
42
|
+
btnRules: string[]; // 按钮权限
|
|
43
|
+
info: SystemAdminInfo;
|
|
44
|
+
menus: SystemMenuInfo[];
|
|
45
|
+
}
|
|
46
|
+
export function userInfoApi<T extends boolean = false>(returnAxios: T = false as T, noLoading = true) {
|
|
47
|
+
return request<UserInfo, [], T>(
|
|
48
|
+
() => ({
|
|
49
|
+
url: 'login/info',
|
|
50
|
+
method: 'post',
|
|
51
|
+
}),
|
|
52
|
+
{ noLoading },
|
|
53
|
+
returnAxios,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { PageParam, PageResult } from '@/api/api.model.js';
|
|
2
|
+
import request, { RequestOptions } from '@/utils/request.js';
|
|
3
|
+
import { FileInfo } from '../file.js';
|
|
4
|
+
import { SystemMenuInfo } from './menu.js';
|
|
5
|
+
import { SystemRoleInfo } from './role.js';
|
|
6
|
+
|
|
7
|
+
//管理员
|
|
8
|
+
export class SystemAdmin {
|
|
9
|
+
username = '' as string; //用户名
|
|
10
|
+
nickname = '' as string; //昵称
|
|
11
|
+
password = '' as string; //密码
|
|
12
|
+
avatar = null as FileInfo | null; //头像
|
|
13
|
+
email = '' as string; //邮箱
|
|
14
|
+
mobile = '' as string; //手机号
|
|
15
|
+
status = 1 as 1 | 0 | undefined; //状态:1=启用;0=禁用
|
|
16
|
+
roleIds = [] as string[]; //具有的角色
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type SystemAdminInfo = Omit<SystemAdmin, 'roleIds'> & {
|
|
20
|
+
id: string; //ID
|
|
21
|
+
loginFailure: number | undefined; //登录失败次数
|
|
22
|
+
lastLoginAt: string | null; //最后登录时间
|
|
23
|
+
lastLoginIp: string; //最后登录ip
|
|
24
|
+
roles: Array<Omit<SystemRoleInfo, 'menus'>>;
|
|
25
|
+
roleMenus: NonNullable<SystemMenuInfo>;
|
|
26
|
+
createdAt: string; //创建时间
|
|
27
|
+
updatedAt: string; //最后更新时间
|
|
28
|
+
createdAdmin: Omit<SystemAdmin, 'createdAdmin' | 'updatedAdmin'> | null;
|
|
29
|
+
updatedAdmin: Omit<SystemAdmin, 'createdAdmin' | 'updatedAdmin'> | null;
|
|
30
|
+
};
|
|
31
|
+
//添加管理员信息
|
|
32
|
+
export function addSystemAdminApi() {
|
|
33
|
+
return request<SystemAdminInfo, [SystemAdmin]>(
|
|
34
|
+
(data) => ({
|
|
35
|
+
url: 'system/admin/add',
|
|
36
|
+
method: 'post',
|
|
37
|
+
data: data,
|
|
38
|
+
}),
|
|
39
|
+
{ success: true },
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type SystemAdminListResult = PageResult<SystemAdminInfo>;
|
|
44
|
+
export class SystemAdminListParam extends PageParam {
|
|
45
|
+
id?: string; //ID
|
|
46
|
+
username?: string; //用户名
|
|
47
|
+
nickname?: string; //昵称
|
|
48
|
+
password?: string; //密码
|
|
49
|
+
avatar?: FileInfo | null; //头像
|
|
50
|
+
email?: string; //邮箱
|
|
51
|
+
mobile?: string; //手机号
|
|
52
|
+
loginFailure?: number; //登录失败次数
|
|
53
|
+
startLastLoginAt?: string | null; //最后登录时间(起)
|
|
54
|
+
endLastLoginAt?: string | null; //最后登录时间(止)
|
|
55
|
+
lastLoginIp?: string; //最后登录ip
|
|
56
|
+
status?: 1 | 0; //状态:1=启用;0=禁用
|
|
57
|
+
isSuper?: 1 | 0; //超级管理员:1=是;0=不是
|
|
58
|
+
roles?: Array<Omit<SystemRoleInfo, 'menus'>> | null; //具有的角色
|
|
59
|
+
startCreatedAt?: string; //创建时间(起)
|
|
60
|
+
endCreatedAt?: string; //创建时间(止)
|
|
61
|
+
startUpdatedAt?: string; //最后更新时间(起)
|
|
62
|
+
endUpdatedAt?: string; //最后更新时间(止)
|
|
63
|
+
}
|
|
64
|
+
//获取管理员列表
|
|
65
|
+
export function systemAdminListApi(options?: RequestOptions<SystemAdminListResult, [SystemAdminListParam]>) {
|
|
66
|
+
return request<SystemAdminListResult, [SystemAdminListParam]>(
|
|
67
|
+
(data) => ({
|
|
68
|
+
url: 'system/admin/',
|
|
69
|
+
method: 'post',
|
|
70
|
+
data: data,
|
|
71
|
+
}),
|
|
72
|
+
Object.assign({ noLoading: true, clearEmpty: ['', undefined, null] }, options),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//根据id获取管理员详情
|
|
77
|
+
export function systemAdminInfoApi(options?: RequestOptions<SystemAdminInfo, [string]>) {
|
|
78
|
+
return request<SystemAdminInfo, [string]>(
|
|
79
|
+
(id) => ({
|
|
80
|
+
url: `system/admin/info/${id}`,
|
|
81
|
+
method: 'get',
|
|
82
|
+
}),
|
|
83
|
+
Object.assign({ noLoading: true }, options),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type UpdateSystemAdminInfoParam = Omit<Partial<SystemAdminInfo>, 'id' | 'loginFailure' | 'lastLoginAt' | 'lastLoginIp' | 'createdAt' | 'updatedAt' | 'createdAdmin' | 'updatedAdmin'> & {
|
|
88
|
+
roleIds: string[];
|
|
89
|
+
};
|
|
90
|
+
//修改管理员信息
|
|
91
|
+
export function updateSystemAdminApi(options?: RequestOptions<SystemAdminInfo, [string, UpdateSystemAdminInfoParam]>) {
|
|
92
|
+
return request<SystemAdminInfo, [string, UpdateSystemAdminInfoParam]>(
|
|
93
|
+
(id, data) => ({
|
|
94
|
+
url: `system/admin/up/${id}`,
|
|
95
|
+
method: 'post',
|
|
96
|
+
data: data,
|
|
97
|
+
}),
|
|
98
|
+
Object.assign({ success: true, noLoading: true }, options),
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//删除管理员
|
|
103
|
+
export function delSystemAdminApi(options?: RequestOptions<null, [string]>) {
|
|
104
|
+
return request<null, [string]>(
|
|
105
|
+
(id) => ({
|
|
106
|
+
url: `system/admin/del/${id}`,
|
|
107
|
+
method: 'post',
|
|
108
|
+
}),
|
|
109
|
+
Object.assign({ noLoading: true }, options),
|
|
110
|
+
);
|
|
111
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { PageParam, PageResult } from '@/api/api.model.js';
|
|
2
|
+
import { TreeArrayItem } from '@/utils/helper.js';
|
|
3
|
+
import request, { RequestOptions } from '@/utils/request.js';
|
|
4
|
+
import { SystemAdmin } from './admin.js';
|
|
5
|
+
|
|
6
|
+
//菜单
|
|
7
|
+
export class SystemMenu {
|
|
8
|
+
id?: string; //ID
|
|
9
|
+
parentId = '' as string | null; //父级id
|
|
10
|
+
title = '' as string; //菜单名称
|
|
11
|
+
menuType = undefined as 1 | 2 | 3 | undefined; //类型:1=目录;2=菜单;3=按钮
|
|
12
|
+
status = 1 as 1 | 0 | undefined; //状态:1=启用;0=禁用
|
|
13
|
+
rule = '' as string; //权限
|
|
14
|
+
orderNum = 999 as number | undefined; //排序(降序)
|
|
15
|
+
path = '' as string; //路径
|
|
16
|
+
isLink = 0 as 0 | 1 | undefined; //外链:1=是;0=否
|
|
17
|
+
component = '' as string; //组件路径(相对于views文件夹)
|
|
18
|
+
hideMenu = 0 as 0 | 1 | undefined; //隐藏:1=是;0=否
|
|
19
|
+
cache = 1 as 0 | 1 | undefined; //缓存:1=是;0=否
|
|
20
|
+
icon = '' as string; //图标
|
|
21
|
+
affix = 0 as 0 | 1 | undefined; //固定tag:1=是;0=否
|
|
22
|
+
alwaysShow = 0 as 0 | 1 | undefined; //恒定展示(只有一个子元素时不隐藏):1=是;0=否
|
|
23
|
+
breadcrumb = 1 as 0 | 1 | undefined; //面包屑:1=展示;0=不展示
|
|
24
|
+
createdAt = '' as string; //创建时间
|
|
25
|
+
updatedAt = '' as string; //最后更新时间
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type SystemMenuInfo = SystemMenu & {
|
|
29
|
+
id: string; //ID
|
|
30
|
+
createdAdmin: Omit<SystemAdmin, 'createdAdmin' | 'updatedAdmin'> | null;
|
|
31
|
+
updatedAdmin: Omit<SystemAdmin, 'createdAdmin' | 'updatedAdmin'> | null;
|
|
32
|
+
};
|
|
33
|
+
//添加菜单信息
|
|
34
|
+
export function addSystemMenuApi() {
|
|
35
|
+
return request<SystemMenuInfo, [SystemMenu]>(
|
|
36
|
+
(data) => ({
|
|
37
|
+
url: 'system/menu/add',
|
|
38
|
+
method: 'post',
|
|
39
|
+
data: data,
|
|
40
|
+
}),
|
|
41
|
+
{ success: true },
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type SystemMenuListResult = PageResult<SystemMenuInfo>;
|
|
46
|
+
export class SystemMenuListParam extends PageParam {
|
|
47
|
+
parentId?: string | null; //父级id
|
|
48
|
+
id?: string; //ID
|
|
49
|
+
title?: string; //菜单名称
|
|
50
|
+
menuType?: 1 | 2 | 3; //类型:1=目录;2=菜单;3=按钮
|
|
51
|
+
status?: 1 | 0; //状态:1=启用;0=禁用
|
|
52
|
+
rule?: string; //权限
|
|
53
|
+
orderNum?: number; //排序(降序)
|
|
54
|
+
path?: string; //路径
|
|
55
|
+
isLink?: 0 | 1; //外链:1=是;0=否
|
|
56
|
+
component?: string; //组件路径(相对于views文件夹)
|
|
57
|
+
hideMenu?: 0 | 1; //隐藏:1=是;0=否
|
|
58
|
+
cache?: 0 | 1; //缓存:1=是;0=否
|
|
59
|
+
icon?: string; //图标
|
|
60
|
+
affix?: 0 | 1 | 2 | 3 | 4; //固定tag:1=是;0=否
|
|
61
|
+
alwaysShow?: 0 | 1; //恒定展示(只有一个子元素时不隐藏):1=是;0=否
|
|
62
|
+
breadcrumb?: 0 | 1; //面包屑:1=展示;0=不展示
|
|
63
|
+
startCreatedAt?: string; //创建时间(起)
|
|
64
|
+
endCreatedAt?: string; //创建时间(止)
|
|
65
|
+
startUpdatedAt?: string; //最后更新时间(起)
|
|
66
|
+
endUpdatedAt?: string; //最后更新时间(止)
|
|
67
|
+
}
|
|
68
|
+
//获取菜单列表
|
|
69
|
+
export function systemMenuListApi(options?: RequestOptions<SystemMenuListResult, [SystemMenuListParam]>) {
|
|
70
|
+
return request<SystemMenuListResult, [SystemMenuListParam]>(
|
|
71
|
+
(data) => ({
|
|
72
|
+
url: 'system/menu/',
|
|
73
|
+
method: 'post',
|
|
74
|
+
data: data,
|
|
75
|
+
}),
|
|
76
|
+
Object.assign({ noLoading: true, clearEmpty: ['', undefined, null] }, options),
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type SystemMenuTreeAll = TreeArrayItem<SystemMenuInfo, 'children'>[];
|
|
81
|
+
//获取树形结构
|
|
82
|
+
export function systemMenuTreeAllApi(options?: RequestOptions<SystemMenuTreeAll, []>) {
|
|
83
|
+
return request<SystemMenuTreeAll, []>(
|
|
84
|
+
() => ({
|
|
85
|
+
url: 'system/menu/treeAll',
|
|
86
|
+
method: 'get',
|
|
87
|
+
}),
|
|
88
|
+
Object.assign({ noLoading: true }, options),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//根据id获取菜单详情
|
|
93
|
+
export function systemMenuInfoApi(options?: RequestOptions<SystemMenuInfo, [string]>) {
|
|
94
|
+
return request<SystemMenuInfo & { parent?: SystemMenuInfo | null }, [string]>(
|
|
95
|
+
(id) => ({
|
|
96
|
+
url: `system/menu/info/${id}`,
|
|
97
|
+
method: 'get',
|
|
98
|
+
}),
|
|
99
|
+
Object.assign({ noLoading: true }, options),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type UpdateSystemMenuInfoParam = Omit<Partial<SystemMenuInfo>, 'id' | 'createdAt' | 'updatedAt' | 'createdAdmin' | 'updatedAdmin'>;
|
|
104
|
+
//修改菜单信息
|
|
105
|
+
export function updateSystemMenuApi(options?: RequestOptions<SystemMenuInfo, [string, UpdateSystemMenuInfoParam]>) {
|
|
106
|
+
return request<SystemMenuInfo, [string, UpdateSystemMenuInfoParam]>(
|
|
107
|
+
(id, data) => ({
|
|
108
|
+
url: `system/menu/up/${id}`,
|
|
109
|
+
method: 'post',
|
|
110
|
+
data: data,
|
|
111
|
+
}),
|
|
112
|
+
Object.assign({ success: true, noLoading: true }, options),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
//删除菜单
|
|
117
|
+
export function delSystemMenuApi(options?: RequestOptions<null, [string]>) {
|
|
118
|
+
return request<null, [string]>(
|
|
119
|
+
(id) => ({
|
|
120
|
+
url: `system/menu/del/${id}`,
|
|
121
|
+
method: 'post',
|
|
122
|
+
}),
|
|
123
|
+
Object.assign({ noLoading: true }, options),
|
|
124
|
+
);
|
|
125
|
+
}
|