create-young-proj 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/index.mjs +0 -0
- package/package.json +34 -23
- package/template-admin-server/.editorconfig +0 -0
- package/template-admin-server/.nvmrc +0 -0
- package/template-admin-server/.vscode/extensions.json +0 -0
- package/template-admin-server/.vscode/settings.json +0 -0
- package/template-admin-server/README.md +0 -0
- package/template-admin-server/_gitignore +0 -0
- package/template-admin-server/boot.mjs +0 -0
- package/template-admin-server/package.json +0 -0
- package/template-admin-server/rome.json +0 -0
- package/template-admin-server/src/config/config.default.ts +0 -0
- package/template-admin-server/src/configuration.ts +0 -0
- package/template-admin-server/src/controller/admin.controller.ts +0 -0
- package/template-admin-server/src/controller/api.controller.ts +0 -0
- package/template-admin-server/src/controller/base.controller.ts +0 -0
- package/template-admin-server/src/controller/dto/api.ts +0 -0
- package/template-admin-server/src/controller/dto/index.ts +0 -0
- package/template-admin-server/src/controller/dto/menu.ts +0 -0
- package/template-admin-server/src/controller/dto/role.ts +0 -0
- package/template-admin-server/src/controller/dto/user.ts +0 -0
- package/template-admin-server/src/controller/menu.controller.ts +0 -0
- package/template-admin-server/src/controller/role.controller.ts +0 -0
- package/template-admin-server/src/controller/user.controller.ts +0 -0
- package/template-admin-server/src/entities/Api.ts +0 -0
- package/template-admin-server/src/entities/BaseCreate.ts +0 -0
- package/template-admin-server/src/entities/Menu.ts +0 -0
- package/template-admin-server/src/entities/Role.ts +0 -0
- package/template-admin-server/src/entities/User.ts +0 -0
- package/template-admin-server/src/entities/index.ts +0 -0
- package/template-admin-server/src/filter/default.filter.ts +0 -0
- package/template-admin-server/src/filter/notfound.filter.ts +0 -0
- package/template-admin-server/src/middleware/helper.middleware.ts +0 -0
- package/template-admin-server/src/middleware/index.ts +0 -0
- package/template-admin-server/src/middleware/jwt.middleware.ts +0 -0
- package/template-admin-server/src/middleware/report.middleware.ts +0 -0
- package/template-admin-server/src/service/api.service.ts +0 -0
- package/template-admin-server/src/service/basic.ts +0 -0
- package/template-admin-server/src/service/index.ts +0 -0
- package/template-admin-server/src/service/menu.service.ts +0 -0
- package/template-admin-server/src/service/role.service.ts +0 -0
- package/template-admin-server/src/service/user.service.ts +0 -0
- package/template-admin-server/src/strategy/jwt.strategy.ts +0 -0
- package/template-admin-server/src/types/index.ts +0 -0
- package/template-admin-server/src/types/types.d.ts +0 -0
- package/template-admin-server/tsconfig.json +0 -0
- package/template-nuxt-admin/.eslintrc +14 -0
- package/template-nuxt-admin/.vscode/extensions.json +12 -0
- package/template-nuxt-admin/.vscode/settings.json +25 -0
- package/template-nuxt-admin/Dockerfile +0 -0
- package/template-nuxt-admin/README.md +8 -2
- package/template-nuxt-admin/_gitignore +0 -0
- package/template-nuxt-admin/_npmrc +0 -0
- package/template-nuxt-admin/app.vue +12 -12
- package/template-nuxt-admin/boot.mjs +0 -0
- package/template-nuxt-admin/components/ScreenFull.vue +5 -4
- package/template-nuxt-admin/components/TopSearch.vue +35 -31
- package/template-nuxt-admin/components/TopUser.vue +12 -9
- package/template-nuxt-admin/components/YoungChangePassword.vue +51 -41
- package/template-nuxt-admin/components/YoungCodeInput.vue +31 -25
- package/template-nuxt-admin/components/YoungLink.vue +3 -2
- package/template-nuxt-admin/components/YoungLoading.vue +1 -1
- package/template-nuxt-admin/components/layout/Footer.vue +1 -1
- package/template-nuxt-admin/components/layout/Logo.vue +7 -5
- package/template-nuxt-admin/components/layout/Main.vue +2 -2
- package/template-nuxt-admin/components/layout/NavBar.vue +12 -9
- package/template-nuxt-admin/components/layout/SideBar.vue +6 -4
- package/template-nuxt-admin/components/layout/SubMenu.vue +12 -13
- package/template-nuxt-admin/components/layout/TabsBar.vue +45 -43
- package/template-nuxt-admin/composables/api.ts +39 -37
- package/template-nuxt-admin/composables/apis/delete.ts +7 -7
- package/template-nuxt-admin/composables/apis/get.ts +13 -13
- package/template-nuxt-admin/composables/apis/index.ts +4 -4
- package/template-nuxt-admin/composables/apis/patch.ts +11 -11
- package/template-nuxt-admin/composables/apis/post.ts +17 -17
- package/template-nuxt-admin/composables/config.ts +1 -1
- package/template-nuxt-admin/composables/icon.ts +4 -4
- package/template-nuxt-admin/composables/nav.ts +19 -21
- package/template-nuxt-admin/composables/tags.ts +41 -47
- package/template-nuxt-admin/composables/user.ts +10 -11
- package/template-nuxt-admin/config/.devrc +0 -0
- package/template-nuxt-admin/config/.onlinerc +0 -0
- package/template-nuxt-admin/config/.testrc +0 -0
- package/template-nuxt-admin/env.d.ts +0 -0
- package/template-nuxt-admin/error.vue +37 -29
- package/template-nuxt-admin/layouts/blank.vue +0 -0
- package/template-nuxt-admin/layouts/default.vue +18 -17
- package/template-nuxt-admin/middleware/auth.global.ts +27 -27
- package/template-nuxt-admin/nuxt.config.ts +8 -7
- package/template-nuxt-admin/package.json +36 -16
- package/template-nuxt-admin/pages/home/[id].vue +6 -6
- package/template-nuxt-admin/pages/index.vue +4 -4
- package/template-nuxt-admin/pages/login.vue +70 -52
- package/template-nuxt-admin/pages/system/api.vue +73 -60
- package/template-nuxt-admin/pages/system/hooks/useRole.ts +127 -128
- package/template-nuxt-admin/pages/system/menuList.vue +166 -141
- package/template-nuxt-admin/pages/system/role.vue +62 -34
- package/template-nuxt-admin/pages/system/user.vue +80 -69
- package/template-nuxt-admin/plugins/directive.ts +9 -9
- package/template-nuxt-admin/public/default_avatar.svg +0 -0
- package/template-nuxt-admin/public/favicon.ico +0 -0
- package/template-nuxt-admin/public/image_placeholder.svg +0 -0
- package/template-nuxt-admin/public/tabbar_bg.png +0 -0
- package/template-nuxt-admin/server/api/[...all].ts +3 -3
- package/template-nuxt-admin/server/plugins/env.ts +19 -20
- package/template-nuxt-admin/server/routes/get/env.ts +3 -3
- package/template-nuxt-admin/server/tsconfig.json +0 -0
- package/template-nuxt-admin/server/utils/index.ts +15 -14
- package/template-nuxt-admin/styles/element.scss +0 -0
- package/template-nuxt-admin/styles/index.scss +0 -0
- package/template-nuxt-admin/styles/variable.scss +0 -0
- package/template-nuxt-admin/tsconfig.json +0 -0
- package/template-nuxt-admin/typings/global.d.ts +0 -0
- package/template-nuxt-admin/typings/system.d.ts +0 -0
- package/template-nuxt-admin/typings/user.d.ts +0 -0
- package/template-nuxt-admin/uno.config.ts +1 -1
- package/template-nuxt-admin/utils/tool.ts +65 -65
- package/template-nuxt-admin/yarn.lock +2969 -1437
- package/template-uni-app/.eslintignore +1 -0
- package/template-uni-app/.eslintrc +16 -0
- package/template-uni-app/.vscode/.server-controller-port.log +5 -0
- package/template-uni-app/.vscode/css.code-snippets +0 -0
- package/template-uni-app/.vscode/extensions.json +5 -2
- package/template-uni-app/.vscode/js.code-snippets +0 -0
- package/template-uni-app/.vscode/settings.json +24 -6
- package/template-uni-app/.vscode/vue-html.code-snippets +0 -0
- package/template-uni-app/README.md +0 -0
- package/template-uni-app/_env +0 -0
- package/template-uni-app/_env.development +0 -0
- package/template-uni-app/_env.production +0 -0
- package/template-uni-app/_env.test +0 -0
- package/template-uni-app/_gitignore +0 -0
- package/template-uni-app/_npmrc +0 -0
- package/template-uni-app/auto-imports.d.ts +0 -0
- package/template-uni-app/components.d.ts +0 -0
- package/template-uni-app/custom-plugins/index.ts +2 -2
- package/template-uni-app/custom-plugins/multiconf.ts +17 -19
- package/template-uni-app/custom-plugins/polyfill.ts +9 -9
- package/template-uni-app/dist/dev/mp-weixin/apis/index.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/lib/index.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/index.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/app.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/app.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/app.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/common/assets.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/config/enum.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/config/index.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/config/map.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/project.config.json +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/back.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/h.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/home.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/home_active.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/more.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/my.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/my_active.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/network.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/store/index.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/store/system.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/utils/route.js +0 -0
- package/template-uni-app/dist/dev/mp-weixin/utils/system.js +0 -0
- package/template-uni-app/index.html +0 -0
- package/template-uni-app/manifest.config.ts +11 -11
- package/template-uni-app/package.json +24 -6
- package/template-uni-app/pages.config.ts +11 -11
- package/template-uni-app/pnpm-lock.yaml +2677 -500
- package/template-uni-app/src/App.vue +24 -26
- package/template-uni-app/src/apis/index.ts +15 -14
- package/template-uni-app/src/apis/lib/index.ts +77 -78
- package/template-uni-app/src/apis/requests/get.ts +38 -38
- package/template-uni-app/src/apis/requests/index.ts +2 -2
- package/template-uni-app/src/apis/requests/post.ts +8 -8
- package/template-uni-app/src/components/young-loading/young-loading.vue +14 -9
- package/template-uni-app/src/components/young-loading-mini/young-loading-mini.vue +13 -9
- package/template-uni-app/src/components/young-navbar/young-navbar.vue +43 -44
- package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +39 -35
- package/template-uni-app/src/config/enum.ts +1 -1
- package/template-uni-app/src/config/index.ts +2 -2
- package/template-uni-app/src/config/map.ts +4 -4
- package/template-uni-app/src/env.d.ts +0 -0
- package/template-uni-app/src/layouts/default.vue +6 -7
- package/template-uni-app/src/layouts/tabbar.vue +15 -12
- package/template-uni-app/src/main.ts +7 -7
- package/template-uni-app/src/manifest.json +1 -1
- package/template-uni-app/src/pages/demo/index.vue +16 -10
- package/template-uni-app/src/pages/index.vue +36 -20
- package/template-uni-app/src/pages/my.vue +7 -5
- package/template-uni-app/src/pages.json +1 -1
- package/template-uni-app/src/static/back.png +0 -0
- package/template-uni-app/src/static/h.png +0 -0
- package/template-uni-app/src/static/home.png +0 -0
- package/template-uni-app/src/static/home_active.png +0 -0
- package/template-uni-app/src/static/more.png +0 -0
- package/template-uni-app/src/static/my.png +0 -0
- package/template-uni-app/src/static/my_active.png +0 -0
- package/template-uni-app/src/static/network.png +0 -0
- package/template-uni-app/src/store/index.ts +6 -6
- package/template-uni-app/src/store/local/index.ts +23 -21
- package/template-uni-app/src/store/system.ts +10 -10
- package/template-uni-app/src/typings/global.d.ts +0 -0
- package/template-uni-app/src/uni.scss +0 -0
- package/template-uni-app/src/utils/auth.ts +93 -84
- package/template-uni-app/src/utils/index.ts +5 -5
- package/template-uni-app/src/utils/map.ts +45 -45
- package/template-uni-app/src/utils/modal.ts +49 -50
- package/template-uni-app/src/utils/route.ts +40 -38
- package/template-uni-app/src/utils/system.ts +25 -24
- package/template-uni-app/tsconfig.json +11 -11
- package/template-uni-app/unocss.config.ts +4 -4
- package/template-uni-app/vite.config.ts +15 -15
- package/template-uni-app/volar.config.js +2 -2
- package/template-vue-admin/.vscode/extensions.json +0 -0
- package/template-vue-admin/.vscode/list-add.code-snippets +0 -0
- package/template-vue-admin/.vscode/list-export.code-snippets +0 -0
- package/template-vue-admin/.vscode/list.code-snippets +0 -0
- package/template-vue-admin/.vscode/settings.json +0 -0
- package/template-vue-admin/Dockerfile +0 -0
- package/template-vue-admin/README.md +0 -0
- package/template-vue-admin/_env +0 -0
- package/template-vue-admin/_gitignore +0 -0
- package/template-vue-admin/boot.mjs +0 -0
- package/template-vue-admin/build/custom-plugin.ts +0 -0
- package/template-vue-admin/build/index.ts +0 -0
- package/template-vue-admin/build/plugins.ts +0 -0
- package/template-vue-admin/config/.devrc +0 -0
- package/template-vue-admin/config/.onlinerc +0 -0
- package/template-vue-admin/config/.testrc +0 -0
- package/template-vue-admin/index.html +0 -0
- package/template-vue-admin/nitro.config.ts +0 -0
- package/template-vue-admin/package.json +0 -0
- package/template-vue-admin/plugins/init.ts +0 -0
- package/template-vue-admin/public/vite.svg +0 -0
- package/template-vue-admin/rome.json +0 -0
- package/template-vue-admin/routes/api/[...all].ts +0 -0
- package/template-vue-admin/routes/get/env.ts +0 -0
- package/template-vue-admin/src/App.vue +0 -0
- package/template-vue-admin/src/apis/delete.ts +0 -0
- package/template-vue-admin/src/apis/get.ts +0 -0
- package/template-vue-admin/src/apis/index.ts +0 -0
- package/template-vue-admin/src/apis/patch.ts +0 -0
- package/template-vue-admin/src/apis/post.ts +0 -0
- package/template-vue-admin/src/assets/img/login_background.jpg +0 -0
- package/template-vue-admin/src/auto-components.d.ts +0 -0
- package/template-vue-admin/src/auto-imports.d.ts +0 -0
- package/template-vue-admin/src/layouts/blank.vue +0 -0
- package/template-vue-admin/src/layouts/default/components/Link.vue +0 -0
- package/template-vue-admin/src/layouts/default/components/Logo.vue +0 -0
- package/template-vue-admin/src/layouts/default/components/Menu.vue +0 -0
- package/template-vue-admin/src/layouts/default/components/NavSearch.vue +0 -0
- package/template-vue-admin/src/layouts/default/components/ScrollPane.vue +0 -0
- package/template-vue-admin/src/layouts/default/components/TagsView.vue +0 -0
- package/template-vue-admin/src/layouts/default/components/TopMenu.vue +0 -0
- package/template-vue-admin/src/layouts/default/components/UserCenter.vue +0 -0
- package/template-vue-admin/src/layouts/default/index.vue +0 -0
- package/template-vue-admin/src/main.ts +0 -0
- package/template-vue-admin/src/modules/1-router.ts +0 -0
- package/template-vue-admin/src/modules/2-pinia.ts +0 -0
- package/template-vue-admin/src/modules/3-net.ts +0 -0
- package/template-vue-admin/src/modules/4-auth.ts +0 -0
- package/template-vue-admin/src/modules/5-checkupdate.ts +0 -0
- package/template-vue-admin/src/shims.d.ts +0 -0
- package/template-vue-admin/src/stores/index.ts +0 -0
- package/template-vue-admin/src/stores/local/index.ts +0 -0
- package/template-vue-admin/src/stores/session/index.ts +0 -0
- package/template-vue-admin/src/stores/tags.ts +0 -0
- package/template-vue-admin/src/typings/global.d.ts +0 -0
- package/template-vue-admin/src/typings/index.ts +0 -0
- package/template-vue-admin/src/typings/system.d.ts +0 -0
- package/template-vue-admin/src/views/403.vue +0 -0
- package/template-vue-admin/src/views/[...all_404].vue +0 -0
- package/template-vue-admin/src/views/base/login.vue +0 -0
- package/template-vue-admin/src/views/dashboard/[name].vue +0 -0
- package/template-vue-admin/src/views/index.vue +0 -0
- package/template-vue-admin/src/views/system/api.vue +0 -0
- package/template-vue-admin/src/views/system/hooks/useRole.ts +0 -0
- package/template-vue-admin/src/views/system/menuList.vue +0 -0
- package/template-vue-admin/src/views/system/role.vue +0 -0
- package/template-vue-admin/src/views/system/user.vue +0 -0
- package/template-vue-admin/src/vite-env.d.ts +0 -0
- package/template-vue-admin/tsconfig.json +0 -0
- package/template-vue-admin/tsconfig.node.json +0 -0
- package/template-vue-admin/unocss.config.ts +0 -0
- package/template-vue-admin/vite.config.ts +0 -0
- package/template-vue-mobile/.vscode/base.code-snippets +0 -0
- package/template-vue-mobile/.vscode/extensions.json +0 -0
- package/template-vue-mobile/.vscode/settings.json +0 -0
- package/template-vue-mobile/Dockerfile +0 -0
- package/template-vue-mobile/README.md +0 -0
- package/template-vue-mobile/_env +0 -0
- package/template-vue-mobile/_gitignore +0 -0
- package/template-vue-mobile/boot.mjs +0 -0
- package/template-vue-mobile/build/custom-plugin.ts +0 -0
- package/template-vue-mobile/build/index.ts +0 -0
- package/template-vue-mobile/build/plugins.ts +0 -0
- package/template-vue-mobile/config/.devrc +0 -0
- package/template-vue-mobile/config/.onlinerc +0 -0
- package/template-vue-mobile/config/.testrc +0 -0
- package/template-vue-mobile/index.html +0 -0
- package/template-vue-mobile/nitro.config.ts +0 -0
- package/template-vue-mobile/package.json +0 -0
- package/template-vue-mobile/plugins/env.ts +0 -0
- package/template-vue-mobile/public/vite.svg +0 -0
- package/template-vue-mobile/rome.json +0 -0
- package/template-vue-mobile/routes/[...all].ts +0 -0
- package/template-vue-mobile/routes/get/env.ts +0 -0
- package/template-vue-mobile/src/App.vue +0 -0
- package/template-vue-mobile/src/auto-components.d.ts +0 -0
- package/template-vue-mobile/src/auto-imports.d.ts +0 -0
- package/template-vue-mobile/src/components/Init.vue +0 -0
- package/template-vue-mobile/src/global.d.ts +0 -0
- package/template-vue-mobile/src/hooks/useVerifyCode.ts +0 -0
- package/template-vue-mobile/src/layouts/blank.vue +0 -0
- package/template-vue-mobile/src/layouts/default.vue +0 -0
- package/template-vue-mobile/src/layouts/sub.vue +0 -0
- package/template-vue-mobile/src/main.ts +0 -0
- package/template-vue-mobile/src/modules/1-router.ts +0 -0
- package/template-vue-mobile/src/modules/2-pinia.ts +0 -0
- package/template-vue-mobile/src/modules/3-net.ts +0 -0
- package/template-vue-mobile/src/modules/4-auth.ts +0 -0
- package/template-vue-mobile/src/views/[...all_404].vue +0 -0
- package/template-vue-mobile/src/views/base/login.vue +0 -0
- package/template-vue-mobile/src/views/base/resetPasswd.vue +0 -0
- package/template-vue-mobile/src/views/index.vue +0 -0
- package/template-vue-mobile/src/views/my.vue +0 -0
- package/template-vue-mobile/src/views/sub.vue +0 -0
- package/template-vue-mobile/src/vite-env.d.ts +0 -0
- package/template-vue-mobile/tsconfig.json +0 -0
- package/template-vue-mobile/tsconfig.node.json +0 -0
- package/template-vue-mobile/unocss.config.ts +0 -0
- package/template-vue-mobile/vite.config.ts +0 -0
- package/template-vue-mobile/yarn.lock +0 -0
- package/template-vue-thin/.vscode/extensions.json +0 -0
- package/template-vue-thin/.vscode/settings.json +0 -0
- package/template-vue-thin/README.md +0 -0
- package/template-vue-thin/_env +0 -0
- package/template-vue-thin/_gitignore +0 -0
- package/template-vue-thin/index.html +0 -0
- package/template-vue-thin/package.json +0 -0
- package/template-vue-thin/public/vite.svg +0 -0
- package/template-vue-thin/src/App.vue +0 -0
- package/template-vue-thin/src/layouts/blank.vue +0 -0
- package/template-vue-thin/src/layouts/default.vue +0 -0
- package/template-vue-thin/src/layouts/list.vue +0 -0
- package/template-vue-thin/src/main.ts +0 -0
- package/template-vue-thin/src/views/[...all_404].vue +0 -0
- package/template-vue-thin/src/views/index.vue +0 -0
- package/template-vue-thin/src/views/list.vue +0 -0
- package/template-vue-thin/src/vite-env.d.ts +0 -0
- package/template-vue-thin/tsconfig.json +0 -0
- package/template-vue-thin/tsconfig.node.json +0 -0
- package/template-vue-thin/unocss.config.ts +0 -0
- package/template-vue-thin/vite.config.ts +0 -0
- package/template-nuxt-admin/rome.json +0 -26
- package/template-uni-app/rome.json +0 -26
@@ -5,46 +5,46 @@
|
|
5
5
|
* @Description:
|
6
6
|
*/
|
7
7
|
export default defineNuxtRouteMiddleware(async (to, from) => {
|
8
|
-
if (to.matched.length === 0)
|
9
|
-
throw createError({ message: '页面不存在', statusCode: 404 })
|
10
|
-
}
|
8
|
+
if (to.matched.length === 0)
|
9
|
+
throw createError({ message: '页面不存在', statusCode: 404 })
|
11
10
|
|
12
|
-
const { hasLogin } = storeToRefs(useUserStore())
|
13
|
-
const { nav_arr, flat_nav_arr } = storeToRefs(useNavStore())
|
11
|
+
const { hasLogin } = storeToRefs(useUserStore())
|
12
|
+
const { nav_arr, flat_nav_arr } = storeToRefs(useNavStore())
|
14
13
|
|
15
14
|
const changeTitle = () => {
|
16
|
-
const nav = flat_nav_arr.value.find(
|
17
|
-
if (nav && nav.title)
|
18
|
-
to.meta.title = nav.title
|
19
|
-
}
|
15
|
+
const nav = flat_nav_arr.value.find(item => item.component === to.path)
|
16
|
+
if (nav && nav.title)
|
17
|
+
to.meta.title = nav.title
|
20
18
|
|
21
|
-
document.title = (to.meta.title as string) || window.__YOUNG_ENV__.NUXT_PUBLIC_TITLE
|
22
|
-
}
|
19
|
+
document.title = (to.meta.title as string) || window.__YOUNG_ENV__.NUXT_PUBLIC_TITLE
|
20
|
+
}
|
23
21
|
|
24
|
-
const { addView } = useTagsStore()
|
22
|
+
const { addView } = useTagsStore()
|
25
23
|
|
26
24
|
// 页面无需登录
|
27
25
|
if (to.meta.auth === false) {
|
28
|
-
changeTitle()
|
29
|
-
addView(to)
|
30
|
-
return
|
26
|
+
changeTitle()
|
27
|
+
addView(to)
|
28
|
+
return
|
31
29
|
}
|
32
30
|
|
33
31
|
if (!hasLogin.value && to.path !== '/login') {
|
34
32
|
// 页面需要登录,但是未登录
|
35
|
-
showFailToast('未登录或登录过期,请重新登录')
|
36
|
-
return navigateTo(`/login?redirect=${encodeURIComponent(to.fullPath)}`)
|
37
|
-
}
|
33
|
+
showFailToast('未登录或登录过期,请重新登录')
|
34
|
+
return navigateTo(`/login?redirect=${encodeURIComponent(to.fullPath)}`)
|
35
|
+
}
|
36
|
+
else if (hasLogin.value && to.path === '/login') {
|
38
37
|
// 已登录进入登录页
|
39
|
-
return navigateTo('/')
|
40
|
-
}
|
41
|
-
|
38
|
+
return navigateTo('/')
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
nav_arr.value.length === 0 && (await generateNavData())
|
42
42
|
if (hasPermission(to.path)) {
|
43
|
-
changeTitle()
|
44
|
-
addView(to)
|
45
|
-
|
46
|
-
|
47
|
-
throw createError({ message: '无权限,请联系系统管理员', statusCode: 403 })
|
43
|
+
changeTitle()
|
44
|
+
addView(to)
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
throw createError({ message: '无权限,请联系系统管理员', statusCode: 403 })
|
48
48
|
}
|
49
49
|
}
|
50
|
-
})
|
50
|
+
})
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/*
|
2
2
|
* @Author: zhangyang
|
3
3
|
* @Date: 2023-05-25 19:45:20
|
4
|
-
* @LastEditTime: 2023-
|
4
|
+
* @LastEditTime: 2023-09-06 16:13:06
|
5
5
|
* @Description:
|
6
6
|
*/
|
7
|
-
import { resolve } from 'node:path'
|
7
|
+
import { resolve } from 'node:path'
|
8
8
|
|
9
9
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
10
10
|
export default defineNuxtConfig({
|
@@ -56,7 +56,7 @@ export default defineNuxtConfig({
|
|
56
56
|
// native: true,
|
57
57
|
// js 实现,仅指令生效 v-lazy-load
|
58
58
|
// directiveOnly: true,
|
59
|
-
// @ts-
|
59
|
+
// @ts-expect-error js 实现的占位图
|
60
60
|
defaultImage: '/image_placeholder.svg',
|
61
61
|
},
|
62
62
|
|
@@ -66,9 +66,10 @@ export default defineNuxtConfig({
|
|
66
66
|
},
|
67
67
|
},
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
// 开发调试工具,按需启用
|
70
|
+
// devtools: {
|
71
|
+
// enabled: true,
|
72
|
+
// },
|
72
73
|
|
73
74
|
modules: [
|
74
75
|
'@vueuse/nuxt',
|
@@ -98,4 +99,4 @@ export default defineNuxtConfig({
|
|
98
99
|
},
|
99
100
|
},
|
100
101
|
},
|
101
|
-
})
|
102
|
+
})
|
@@ -1,44 +1,64 @@
|
|
1
1
|
{
|
2
2
|
"name": "nuxt-app",
|
3
|
+
"version": "0.0.0",
|
3
4
|
"private": true,
|
4
5
|
"scripts": {
|
5
6
|
"build": "nuxt build",
|
6
7
|
"dev": "nuxt dev --host",
|
7
8
|
"generate": "nuxt generate",
|
8
9
|
"preview": "nuxt preview --host",
|
9
|
-
"postinstall": "nuxt prepare"
|
10
|
+
"postinstall": "nuxt prepare",
|
11
|
+
"lint": "eslint .",
|
12
|
+
"lint:fix": "eslint . --fix"
|
13
|
+
},
|
14
|
+
"dependencies": {
|
15
|
+
"@bluesyoung/casdoor-auth": "^0.1.0",
|
16
|
+
"@bluesyoung/http": "^0.3.4",
|
17
|
+
"@bluesyoung/ui-vue3": "^0.1.1",
|
18
|
+
"@bluesyoung/ui-vue3-element-plus": "0.11.6",
|
19
|
+
"@bluesyoung/utils": "0.2.1",
|
20
|
+
"@wangeditor/editor": "^5.1.23",
|
21
|
+
"@wangeditor/editor-for-vue": "^5.1.12",
|
22
|
+
"c12": "^1.4.2",
|
23
|
+
"file-saver": "^2.0.5",
|
24
|
+
"http-proxy": "^1.18.1",
|
25
|
+
"jszip": "^3.10.1",
|
26
|
+
"md5": "^2.3.0",
|
27
|
+
"qrcode": "^1.5.3",
|
28
|
+
"sortablejs": "^1.15.0",
|
29
|
+
"vue-cropper": "^1.0.9"
|
10
30
|
},
|
11
31
|
"devDependencies": {
|
32
|
+
"@antfu/eslint-config": "^0.41.0",
|
12
33
|
"@bluesyoung/logger": "^0.0.1",
|
13
34
|
"@element-plus/nuxt": "^1.0.5",
|
14
35
|
"@iconify/json": "^2.2.93",
|
15
36
|
"@nuxt/devtools": "^0.8.2",
|
16
37
|
"@pinia/nuxt": "^0.4.11",
|
17
38
|
"@types/file-saver": "^2.0.5",
|
18
|
-
"@types/
|
39
|
+
"@types/md5": "^2.3.2",
|
40
|
+
"@types/node": "20.5.9",
|
19
41
|
"@types/qrcode": "^1.5.1",
|
20
|
-
"@unocss/nuxt": "^0.55.
|
42
|
+
"@unocss/nuxt": "^0.55.6",
|
21
43
|
"@vant/nuxt": "^1.0.2",
|
22
44
|
"@vueuse/nuxt": "^10.2.1",
|
45
|
+
"add": "^2.0.6",
|
23
46
|
"dayjs": "^1.11.9",
|
24
47
|
"element-plus": "^2.3.8",
|
25
|
-
"
|
48
|
+
"eslint": "^8.48.0",
|
49
|
+
"lint-staged": "^14.0.1",
|
50
|
+
"nuxt": "^3.7.1",
|
26
51
|
"nuxt-lazy-load": "^3.0.4",
|
27
52
|
"pinia": "^2.1.4",
|
28
53
|
"sass": "^1.64.0",
|
54
|
+
"simple-git-hooks": "^2.9.0",
|
55
|
+
"typescript": "^5.2.2",
|
29
56
|
"vant": "^4.6.2"
|
30
57
|
},
|
31
|
-
"
|
32
|
-
"
|
33
|
-
|
34
|
-
|
35
|
-
"
|
36
|
-
"c12": "^1.4.2",
|
37
|
-
"file-saver": "^2.0.5",
|
38
|
-
"http-proxy": "^1.18.1",
|
39
|
-
"jszip": "^3.10.1",
|
40
|
-
"qrcode": "^1.5.3",
|
41
|
-
"sortablejs": "^1.15.0",
|
42
|
-
"vue-cropper": "^0.6.2"
|
58
|
+
"simple-git-hooks": {
|
59
|
+
"pre-commit": "npx lint-staged"
|
60
|
+
},
|
61
|
+
"lint-staged": {
|
62
|
+
"*": "eslint --fix"
|
43
63
|
}
|
44
64
|
}
|
@@ -8,15 +8,15 @@
|
|
8
8
|
definePageMeta({
|
9
9
|
title: '工作台',
|
10
10
|
auth: false,
|
11
|
-
noCache: true
|
12
|
-
})
|
11
|
+
noCache: true,
|
12
|
+
})
|
13
13
|
|
14
|
-
const { nick } = storeToRefs(useUserStore())
|
15
|
-
const { nav_arr } = storeToRefs(useNavStore())
|
14
|
+
const { nick } = storeToRefs(useUserStore())
|
15
|
+
const { nav_arr } = storeToRefs(useNavStore())
|
16
16
|
|
17
17
|
onMounted(() => {
|
18
|
-
nav_arr.value.length === 0 && generateNavData()
|
19
|
-
})
|
18
|
+
nav_arr.value.length === 0 && generateNavData()
|
19
|
+
})
|
20
20
|
</script>
|
21
21
|
|
22
22
|
<template>
|
@@ -5,15 +5,15 @@
|
|
5
5
|
* @Description:
|
6
6
|
-->
|
7
7
|
<script lang="ts" setup>
|
8
|
-
import { isMobile } from '@bluesyoung/utils'
|
9
|
-
import type { FormInstance } from 'element-plus'
|
8
|
+
import { isMobile } from '@bluesyoung/utils'
|
9
|
+
import type { FormInstance } from 'element-plus'
|
10
10
|
|
11
11
|
definePageMeta({
|
12
12
|
auth: false,
|
13
13
|
title: '用户登录',
|
14
14
|
noCache: true,
|
15
|
-
layout: 'blank'
|
16
|
-
})
|
15
|
+
layout: 'blank',
|
16
|
+
})
|
17
17
|
|
18
18
|
const {
|
19
19
|
NUXT_PUBLIC_LOGIN_LOGO: LoginLogo,
|
@@ -21,91 +21,104 @@ const {
|
|
21
21
|
NUXT_PUBLIC_TITLE: Title,
|
22
22
|
NUXT_PUBLIC_SUB_TITLE: SubTitle,
|
23
23
|
NUXT_PUBLIC_SLOGAN: SloGan,
|
24
|
-
NUXT_PUBLIC_CURRENT_VERSION: Version
|
25
|
-
} = window.__YOUNG_ENV__
|
24
|
+
NUXT_PUBLIC_CURRENT_VERSION: Version,
|
25
|
+
} = window.__YOUNG_ENV__
|
26
26
|
|
27
|
-
const { SaveFlag, hasLogin, cookie } = storeToRefs(useUserStore())
|
27
|
+
const { SaveFlag, hasLogin, cookie } = storeToRefs(useUserStore())
|
28
28
|
|
29
|
-
const loginType = ref<'account' | 'code'>('account')
|
29
|
+
const loginType = ref<'account' | 'code'>('account')
|
30
30
|
|
31
31
|
const form = reactive<LoginForm>({
|
32
32
|
mobile: '',
|
33
33
|
vercode: '',
|
34
34
|
password: '',
|
35
|
-
})
|
35
|
+
})
|
36
36
|
|
37
|
-
const formRef = ref<FormInstance>()
|
37
|
+
const formRef = ref<FormInstance>()
|
38
38
|
|
39
|
-
|
39
|
+
function loginHandler() {
|
40
40
|
formRef.value?.validate(async (valid: boolean) => {
|
41
41
|
try {
|
42
42
|
if (valid) {
|
43
|
-
const { enter } = useFullscreen()
|
44
|
-
const { width, height } = useWindowSize()
|
43
|
+
const { enter } = useFullscreen()
|
44
|
+
const { width, height } = useWindowSize()
|
45
45
|
|
46
|
-
const data = await apis.post.login(form)
|
46
|
+
const data = await apis.post.login(form)
|
47
47
|
if (data) {
|
48
|
-
cookie.value = data
|
49
|
-
height.value > width.value && enter()
|
50
|
-
showSuccessToast('登录成功!')
|
51
|
-
navigateTo('/')
|
48
|
+
cookie.value = data
|
49
|
+
height.value > width.value && enter()
|
50
|
+
showSuccessToast('登录成功!')
|
51
|
+
navigateTo('/')
|
52
52
|
}
|
53
|
-
} else {
|
54
|
-
ElMessage.error('请仔细检查输入内容');
|
55
|
-
return;
|
56
53
|
}
|
57
|
-
|
58
|
-
|
54
|
+
else {
|
55
|
+
ElMessage.error('请仔细检查输入内容')
|
56
|
+
}
|
57
|
+
}
|
58
|
+
catch (error) {
|
59
|
+
console.error(error)
|
59
60
|
}
|
60
|
-
})
|
61
|
-
}
|
61
|
+
})
|
62
|
+
}
|
62
63
|
|
63
64
|
onMounted(() => {
|
64
65
|
if (SaveFlag.value && hasLogin.value) {
|
65
66
|
navigateTo({
|
66
67
|
path: '/',
|
67
|
-
replace: true
|
68
|
-
})
|
68
|
+
replace: true,
|
69
|
+
})
|
69
70
|
}
|
70
|
-
})
|
71
|
+
})
|
71
72
|
</script>
|
72
73
|
|
73
74
|
<template>
|
74
|
-
<img :src="LoginBg" class="absolute object-center object-cover w-100vw h-100vh blur-6 brightness-50"
|
75
|
+
<img :src="LoginBg" class="absolute object-center object-cover w-100vw h-100vh blur-6 brightness-50">
|
75
76
|
<div class="flex flex-col items-center login-container pt-6%">
|
76
77
|
<div class="w-80px h-80px">
|
77
|
-
<img class="h-full" :src="LoginLogo" referrerpolicy="no-referrer"
|
78
|
+
<img class="h-full" :src="LoginLogo" referrerpolicy="no-referrer">
|
78
79
|
</div>
|
79
|
-
<div class="title">
|
80
|
-
|
80
|
+
<div class="title">
|
81
|
+
{{ Title }}
|
82
|
+
</div>
|
83
|
+
<div v-if="SubTitle" class="sub-title" v-html="SubTitle" />
|
81
84
|
|
82
85
|
<ElCard class="w-430px mt-3%" lt-sm="w-[96%] mx-[2%]">
|
83
86
|
<ElForm ref="formRef" :model="form">
|
84
87
|
<VanTabs v-model:active="loginType" size="large" @change="formRef?.resetFields?.()">
|
85
88
|
<VanTab name="account" title="账密登录">
|
86
|
-
<ElFormItem
|
87
|
-
|
88
|
-
|
89
|
-
|
89
|
+
<ElFormItem
|
90
|
+
prop="mobile" :rules="[
|
91
|
+
{ required: true, trigger: 'blur', message: '请输入手机号' },
|
92
|
+
{ message: '请输入合法的手机号', trigger: 'blur', validator: (_: any, v: string) => isMobile(v) },
|
93
|
+
]" class="mt-20px"
|
94
|
+
>
|
90
95
|
<ElInput v-model.trim="form.mobile" placeholder="请输入手机号" maxlength="11" class="!h-52px" clearable />
|
91
96
|
</ElFormItem>
|
92
|
-
<ElFormItem
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
97
|
+
<ElFormItem
|
98
|
+
v-if="loginType === 'account'" prop="password" :rules="[
|
99
|
+
{ required: true, trigger: 'blur', message: '请输入密码' },
|
100
|
+
{ min: 8, max: 16, trigger: 'blur', message: '请输入8-16位字符!' },
|
101
|
+
]"
|
102
|
+
>
|
103
|
+
<ElInput
|
104
|
+
v-model.trim="form.password" type="password" minlength="8" maxlength="16" placeholder="请输入密码"
|
105
|
+
class="!h-52px" clearable show-password @keyup.enter="loginHandler"
|
106
|
+
/>
|
98
107
|
</ElFormItem>
|
99
108
|
</VanTab>
|
100
109
|
<VanTab name="code" title="短信登录">
|
101
|
-
<ElFormItem
|
102
|
-
|
103
|
-
|
104
|
-
|
110
|
+
<ElFormItem
|
111
|
+
prop="mobile" :rules="[
|
112
|
+
{ required: true, trigger: 'blur', message: '请输入手机号' },
|
113
|
+
{ message: '请输入合法的手机号', trigger: 'blur', validator: (_: any, v: string) => isMobile(v) },
|
114
|
+
]" class="mt-20px"
|
115
|
+
>
|
105
116
|
<ElInput v-model.trim="form.mobile" placeholder="请输入手机号" maxlength="11" class="!h-52px" clearable />
|
106
117
|
</ElFormItem>
|
107
|
-
<ElFormItem
|
108
|
-
|
118
|
+
<ElFormItem
|
119
|
+
v-if="loginType === 'code'" prop="vercode"
|
120
|
+
:rules="[{ required: true, trigger: 'blur', message: '请输入验证码' }]"
|
121
|
+
>
|
109
122
|
<YoungCodeInput v-model.trim="form.vercode" :tel="form.mobile" @enter="loginHandler" />
|
110
123
|
</ElFormItem>
|
111
124
|
</VanTab>
|
@@ -113,8 +126,12 @@ onMounted(() => {
|
|
113
126
|
|
114
127
|
<ElFormItem>
|
115
128
|
<div class="flex justify-between w-full">
|
116
|
-
<ElCheckbox v-model="SaveFlag"
|
117
|
-
|
129
|
+
<ElCheckbox v-model="SaveFlag">
|
130
|
+
三天之内免登录
|
131
|
+
</ElCheckbox>
|
132
|
+
<ElButton v-show="loginType === 'account'" type="warning" link @click="useChangePassword">
|
133
|
+
忘记密码?
|
134
|
+
</ElButton>
|
118
135
|
</div>
|
119
136
|
</ElFormItem>
|
120
137
|
</ElForm>
|
@@ -128,7 +145,9 @@ onMounted(() => {
|
|
128
145
|
{{ SloGan }}
|
129
146
|
</div>
|
130
147
|
<div class="content-wrapper">
|
131
|
-
<div class="mb-5% text-[#c0c0c0] text-16px">
|
148
|
+
<div class="mb-5% text-[#c0c0c0] text-16px">
|
149
|
+
{{ Version }}
|
150
|
+
</div>
|
132
151
|
</div>
|
133
152
|
</div>
|
134
153
|
</template>
|
@@ -176,4 +195,3 @@ onMounted(() => {
|
|
176
195
|
}
|
177
196
|
}
|
178
197
|
</style>
|
179
|
-
|
@@ -5,24 +5,24 @@
|
|
5
5
|
* @Description:
|
6
6
|
-->
|
7
7
|
<script lang="ts" setup>
|
8
|
-
import {
|
9
|
-
import type { TableDataItem, TableHeadItem,
|
10
|
-
import { deepClone } from '@bluesyoung/utils'
|
11
|
-
import { ElButton, ElTag } from 'element-plus'
|
8
|
+
import { YoungDialog, YoungPagination, YoungSearchForm, YoungSelect, YoungTablePro, useFormMode, useQuery } from '@bluesyoung/ui-vue3-element-plus'
|
9
|
+
import type { SelectOptionItem, TableDataItem, TableHeadItem, YoungSearchScheme } from '@bluesyoung/ui-vue3-element-plus'
|
10
|
+
import { deepClone } from '@bluesyoung/utils'
|
11
|
+
import { ElButton, ElTag } from 'element-plus'
|
12
12
|
|
13
13
|
definePageMeta({
|
14
|
-
title: '接口管理'
|
15
|
-
})
|
14
|
+
title: '接口管理',
|
15
|
+
})
|
16
16
|
|
17
|
-
interface Form extends ApiItem { op?: any
|
17
|
+
interface Form extends ApiItem { op?: any };
|
18
18
|
const FORM_TEMP: Form = {
|
19
19
|
id: 0,
|
20
20
|
path: '',
|
21
21
|
desc: '',
|
22
22
|
method: 'POST',
|
23
23
|
category: '',
|
24
|
-
roleIds: []
|
25
|
-
}
|
24
|
+
roleIds: [],
|
25
|
+
}
|
26
26
|
const {
|
27
27
|
isAdd,
|
28
28
|
isEdit,
|
@@ -32,33 +32,33 @@ const {
|
|
32
32
|
clear,
|
33
33
|
form,
|
34
34
|
formRef,
|
35
|
-
validForm
|
35
|
+
validForm,
|
36
36
|
} = useFormMode<Form>(FORM_TEMP, {
|
37
37
|
addCbk: async () => {
|
38
|
-
const res = await validForm() as boolean
|
38
|
+
const res = await validForm() as boolean
|
39
39
|
if (res) {
|
40
|
-
const v = deepClone(form.value)
|
41
|
-
await apis.post.addApiItem(v)
|
42
|
-
ElMessage.success('新增成功!')
|
40
|
+
const v = deepClone(form.value)
|
41
|
+
await apis.post.addApiItem(v)
|
42
|
+
ElMessage.success('新增成功!')
|
43
43
|
}
|
44
|
-
return res
|
44
|
+
return res
|
45
45
|
},
|
46
46
|
modCbk: async () => {
|
47
|
-
const res = await validForm() as boolean
|
47
|
+
const res = await validForm() as boolean
|
48
48
|
if (res) {
|
49
|
-
const v = deepClone(form.value)
|
50
|
-
await apis.patch.changeApiItem(v)
|
51
|
-
ElMessage.success('修改成功!')
|
49
|
+
const v = deepClone(form.value)
|
50
|
+
await apis.patch.changeApiItem(v)
|
51
|
+
ElMessage.success('修改成功!')
|
52
52
|
}
|
53
|
-
return res
|
53
|
+
return res
|
54
54
|
},
|
55
55
|
delCbk: async (row) => {
|
56
|
-
await apis.delete.deleteApi(row.id.toString())
|
57
|
-
ElMessage.success('删除成功!')
|
58
|
-
query.value.pageNum = 1
|
56
|
+
await apis.delete.deleteApi(row.id.toString())
|
57
|
+
ElMessage.success('删除成功!')
|
58
|
+
query.value.pageNum = 1
|
59
59
|
},
|
60
60
|
cgEffect: () => getList(),
|
61
|
-
})
|
61
|
+
})
|
62
62
|
const tableHead: TableHeadItem<Form>[] = [
|
63
63
|
{ prop: 'id', label: '接口ID' },
|
64
64
|
{ prop: 'desc', label: '接口描述' },
|
@@ -66,41 +66,45 @@ const tableHead: TableHeadItem<Form>[] = [
|
|
66
66
|
{ prop: 'path', label: '接口路径' },
|
67
67
|
{ prop: 'creator', label: '创建信息' },
|
68
68
|
{
|
69
|
-
prop: 'method',
|
69
|
+
prop: 'method',
|
70
|
+
label: '接口方法',
|
71
|
+
render: row => h(ElTag, {
|
70
72
|
effect: 'dark',
|
71
|
-
type: MethodObj[row.method]
|
73
|
+
type: MethodObj[row.method],
|
72
74
|
},
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
)
|
75
|
+
{
|
76
|
+
default: () => row.method,
|
77
|
+
},
|
78
|
+
),
|
77
79
|
},
|
78
80
|
{
|
79
|
-
prop: 'op',
|
81
|
+
prop: 'op',
|
82
|
+
label: '操作',
|
83
|
+
render: row => h('div', [
|
80
84
|
h(ElButton, { type: 'primary', link: true, onClick: () => edit(row) }, { default: () => '编辑' }),
|
81
|
-
h(ElButton, { type: 'danger', link: true, onClick: () => del(row) }, { default: () => '删除' })
|
82
|
-
])
|
83
|
-
}
|
84
|
-
]
|
85
|
-
const tableData = ref<TableDataItem<Form>[]>([])
|
85
|
+
h(ElButton, { type: 'danger', link: true, onClick: () => del(row) }, { default: () => '删除' }),
|
86
|
+
]),
|
87
|
+
},
|
88
|
+
]
|
89
|
+
const tableData = ref<TableDataItem<Form>[]>([])
|
86
90
|
|
87
|
-
|
88
|
-
const { list: role_list } = await apis.get.getRoleList({ noPagination: true })
|
91
|
+
async function getList() {
|
92
|
+
const { list: role_list } = await apis.get.getRoleList({ noPagination: true })
|
89
93
|
roleList.value = (role_list || []).map((item: RoleItem) => {
|
90
94
|
return {
|
91
95
|
label: item.name,
|
92
|
-
value: item.id
|
93
|
-
}
|
94
|
-
})
|
96
|
+
value: item.id,
|
97
|
+
}
|
98
|
+
})
|
95
99
|
|
96
|
-
const { list, pageNum, pageSize, total } = await apis.get.getApiList(query.value)
|
97
|
-
tableData.value = deepClone(list || [])
|
98
|
-
query.value.pageNum = +pageNum || 1
|
99
|
-
query.value.pageSize = +pageSize || 50
|
100
|
-
query.value.total = +total || 0
|
101
|
-
}
|
100
|
+
const { list, pageNum, pageSize, total } = await apis.get.getApiList(query.value)
|
101
|
+
tableData.value = deepClone(list || [])
|
102
|
+
query.value.pageNum = +pageNum || 1
|
103
|
+
query.value.pageSize = +pageSize || 50
|
104
|
+
query.value.total = +total || 0
|
105
|
+
}
|
102
106
|
|
103
|
-
type Query = BaseQuery & Partial<Form
|
107
|
+
type Query = BaseQuery & Partial<Form>
|
104
108
|
const { query, reset } = useQuery<Query>(
|
105
109
|
{
|
106
110
|
pageNum: 1,
|
@@ -109,7 +113,7 @@ const { query, reset } = useQuery<Query>(
|
|
109
113
|
path: '',
|
110
114
|
},
|
111
115
|
getList,
|
112
|
-
)
|
116
|
+
)
|
113
117
|
const queryScheme: YoungSearchScheme<Query> = {
|
114
118
|
path: {
|
115
119
|
type: 'input',
|
@@ -118,27 +122,32 @@ const queryScheme: YoungSearchScheme<Query> = {
|
|
118
122
|
placeholder: '请输入接口路径',
|
119
123
|
},
|
120
124
|
},
|
121
|
-
}
|
125
|
+
}
|
122
126
|
|
123
|
-
const roleList = ref<SelectOptionItem<number>[]>([])
|
127
|
+
const roleList = ref<SelectOptionItem<number>[]>([])
|
124
128
|
|
125
|
-
useTabReOpen(getList)
|
129
|
+
useTabReOpen(getList)
|
126
130
|
</script>
|
131
|
+
|
127
132
|
<template>
|
128
133
|
<ElCard>
|
129
134
|
<YoungSearchForm v-model="query" :search-scheme="queryScheme" :on-search="getList" :on-reset="reset">
|
130
135
|
<template #btns>
|
131
|
-
<ElButton type="success" @click="isAdd = true"
|
136
|
+
<ElButton type="success" @click="isAdd = true">
|
137
|
+
添加接口
|
138
|
+
</ElButton>
|
132
139
|
</template>
|
133
140
|
</YoungSearchForm>
|
134
141
|
</ElCard>
|
135
142
|
|
136
|
-
<br
|
143
|
+
<br>
|
137
144
|
|
138
145
|
<ElCard>
|
139
146
|
<YoungTablePro :table-data="tableData" :table-head="tableHead" />
|
140
|
-
<YoungPagination
|
141
|
-
|
147
|
+
<YoungPagination
|
148
|
+
v-model:page="query.pageNum" v-model:limit="query.pageSize" :total="query.total"
|
149
|
+
@page-change="getList"
|
150
|
+
/>
|
142
151
|
</ElCard>
|
143
152
|
<YoungDialog :is-add="isAdd" :is-edit="isEdit" :diff-form="form" width="520px" @sure="sure" @clear="clear">
|
144
153
|
<template #body>
|
@@ -150,11 +159,15 @@ useTabReOpen(getList);
|
|
150
159
|
<ElInput v-model.trim="form.desc" class="!w-300px" />
|
151
160
|
</ElFormItem>
|
152
161
|
<ElFormItem label="请求方法">
|
153
|
-
<YoungSelect
|
154
|
-
|
162
|
+
<YoungSelect
|
163
|
+
v-model="form.method" class="!w-300px"
|
164
|
+
:options="Object.keys(MethodObj).map((item) => ({ label: item, value: item }))"
|
165
|
+
/>
|
155
166
|
</ElFormItem>
|
156
|
-
<ElFormItem
|
157
|
-
|
167
|
+
<ElFormItem
|
168
|
+
label="接口路径" prop="path"
|
169
|
+
:rules="{ message: '请填写合法的接口路径, eg: /user/list', trigger: 'blur', validator: (_: any, v: string) => /\/(.*)\/(.*)/.test(v) }"
|
170
|
+
>
|
158
171
|
<ElInput v-model.trim="form.path" class="!w-300px" />
|
159
172
|
</ElFormItem>
|
160
173
|
<ElFormItem label="关联角色">
|