create-young-proj 0.12.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +31 -22
- package/dist/index.mjs +34 -34
- package/package.json +12 -11
- package/template-nuxt-admin/README.md +23 -16
- package/template-nuxt-website/README.md +117 -0
- package/template-uni-app/README.md +5 -0
- package/template-admin-server/.editorconfig +0 -11
- package/template-admin-server/.nvmrc +0 -1
- package/template-admin-server/.vscode/extensions.json +0 -6
- package/template-admin-server/.vscode/settings.json +0 -4
- package/template-admin-server/_gitignore +0 -15
- package/template-admin-server/boot.mjs +0 -11
- package/template-admin-server/package.json +0 -60
- package/template-admin-server/rome.json +0 -22
- package/template-admin-server/src/config/config.default.ts +0 -56
- package/template-admin-server/src/configuration.ts +0 -47
- package/template-admin-server/src/controller/admin.controller.ts +0 -397
- package/template-admin-server/src/controller/api.controller.ts +0 -98
- package/template-admin-server/src/controller/base.controller.ts +0 -70
- package/template-admin-server/src/controller/dto/api.ts +0 -47
- package/template-admin-server/src/controller/dto/index.ts +0 -36
- package/template-admin-server/src/controller/dto/menu.ts +0 -41
- package/template-admin-server/src/controller/dto/role.ts +0 -41
- package/template-admin-server/src/controller/dto/user.ts +0 -52
- package/template-admin-server/src/controller/menu.controller.ts +0 -138
- package/template-admin-server/src/controller/role.controller.ts +0 -116
- package/template-admin-server/src/controller/user.controller.ts +0 -108
- package/template-admin-server/src/entities/Api.ts +0 -29
- package/template-admin-server/src/entities/BaseCreate.ts +0 -30
- package/template-admin-server/src/entities/Menu.ts +0 -39
- package/template-admin-server/src/entities/Role.ts +0 -36
- package/template-admin-server/src/entities/User.ts +0 -35
- package/template-admin-server/src/entities/index.ts +0 -10
- package/template-admin-server/src/filter/default.filter.ts +0 -22
- package/template-admin-server/src/filter/notfound.filter.ts +0 -23
- package/template-admin-server/src/middleware/helper.middleware.ts +0 -28
- package/template-admin-server/src/middleware/index.ts +0 -9
- package/template-admin-server/src/middleware/jwt.middleware.ts +0 -32
- package/template-admin-server/src/middleware/report.middleware.ts +0 -26
- package/template-admin-server/src/service/api.service.ts +0 -174
- package/template-admin-server/src/service/basic.ts +0 -118
- package/template-admin-server/src/service/index.ts +0 -10
- package/template-admin-server/src/service/menu.service.ts +0 -139
- package/template-admin-server/src/service/role.service.ts +0 -286
- package/template-admin-server/src/service/user.service.ts +0 -124
- package/template-admin-server/src/strategy/jwt.strategy.ts +0 -26
- package/template-admin-server/src/types/index.ts +0 -42
- package/template-admin-server/src/types/types.d.ts +0 -31
- package/template-admin-server/tsconfig.json +0 -24
- package/template-nuxt-admin/.eslintrc +0 -14
- package/template-nuxt-admin/.vscode/extensions.json +0 -12
- package/template-nuxt-admin/.vscode/settings.json +0 -25
- package/template-nuxt-admin/Dockerfile +0 -41
- package/template-nuxt-admin/_gitignore +0 -23
- package/template-nuxt-admin/_npmrc +0 -2
- package/template-nuxt-admin/app.vue +0 -41
- package/template-nuxt-admin/boot.mjs +0 -16
- package/template-nuxt-admin/components/ScreenFull.vue +0 -19
- package/template-nuxt-admin/components/TopSearch.vue +0 -77
- package/template-nuxt-admin/components/TopUser.vue +0 -72
- package/template-nuxt-admin/components/YoungChangePassword.vue +0 -97
- package/template-nuxt-admin/components/YoungCodeInput.vue +0 -66
- package/template-nuxt-admin/components/YoungLink.vue +0 -24
- package/template-nuxt-admin/components/YoungLoading.vue +0 -39
- package/template-nuxt-admin/components/layout/Footer.vue +0 -29
- package/template-nuxt-admin/components/layout/Logo.vue +0 -54
- package/template-nuxt-admin/components/layout/Main.vue +0 -26
- package/template-nuxt-admin/components/layout/NavBar.vue +0 -89
- package/template-nuxt-admin/components/layout/SideBar.vue +0 -96
- package/template-nuxt-admin/components/layout/SubMenu.vue +0 -52
- package/template-nuxt-admin/components/layout/TabsBar.vue +0 -184
- package/template-nuxt-admin/composables/api.ts +0 -105
- package/template-nuxt-admin/composables/apis/delete.ts +0 -37
- package/template-nuxt-admin/composables/apis/get.ts +0 -83
- package/template-nuxt-admin/composables/apis/index.ts +0 -10
- package/template-nuxt-admin/composables/apis/patch.ts +0 -74
- package/template-nuxt-admin/composables/apis/post.ts +0 -85
- package/template-nuxt-admin/composables/config.ts +0 -13
- package/template-nuxt-admin/composables/icon.ts +0 -27
- package/template-nuxt-admin/composables/nav.ts +0 -75
- package/template-nuxt-admin/composables/tags.ts +0 -136
- package/template-nuxt-admin/composables/user.ts +0 -46
- package/template-nuxt-admin/config/.devrc +0 -1
- package/template-nuxt-admin/config/.onlinerc +0 -1
- package/template-nuxt-admin/config/.testrc +0 -1
- package/template-nuxt-admin/env.d.ts +0 -47
- package/template-nuxt-admin/error.vue +0 -61
- package/template-nuxt-admin/layouts/blank.vue +0 -9
- package/template-nuxt-admin/layouts/default.vue +0 -125
- package/template-nuxt-admin/middleware/auth.global.ts +0 -69
- package/template-nuxt-admin/nuxt.config.ts +0 -106
- package/template-nuxt-admin/package.json +0 -64
- package/template-nuxt-admin/pages/home/[id].vue +0 -28
- package/template-nuxt-admin/pages/index.vue +0 -15
- package/template-nuxt-admin/pages/login.vue +0 -199
- package/template-nuxt-admin/pages/system/api.vue +0 -179
- package/template-nuxt-admin/pages/system/hooks/useRole.ts +0 -335
- package/template-nuxt-admin/pages/system/menuList.vue +0 -353
- package/template-nuxt-admin/pages/system/role.vue +0 -145
- package/template-nuxt-admin/pages/system/user.vue +0 -225
- package/template-nuxt-admin/plugins/directive.ts +0 -26
- package/template-nuxt-admin/public/bg.webp +0 -0
- package/template-nuxt-admin/public/default_avatar.svg +0 -1
- package/template-nuxt-admin/public/favicon.svg +0 -2
- package/template-nuxt-admin/public/image_placeholder.svg +0 -15
- package/template-nuxt-admin/public/logo.svg +0 -2
- package/template-nuxt-admin/public/tabbar_bg.png +0 -0
- package/template-nuxt-admin/server/api/[...all].ts +0 -10
- package/template-nuxt-admin/server/plugins/env.ts +0 -87
- package/template-nuxt-admin/server/routes/get/env.ts +0 -13
- package/template-nuxt-admin/server/tsconfig.json +0 -3
- package/template-nuxt-admin/server/utils/index.ts +0 -36
- package/template-nuxt-admin/styles/element.scss +0 -30
- package/template-nuxt-admin/styles/index.scss +0 -59
- package/template-nuxt-admin/styles/variable.scss +0 -103
- package/template-nuxt-admin/tsconfig.json +0 -7
- package/template-nuxt-admin/typings/global.d.ts +0 -16
- package/template-nuxt-admin/typings/system.d.ts +0 -66
- package/template-nuxt-admin/typings/user.d.ts +0 -19
- package/template-nuxt-admin/uno.config.ts +0 -40
- package/template-nuxt-admin/utils/tool.ts +0 -199
- package/template-nuxt-admin/yarn.lock +0 -8635
- package/template-uni-app/.eslintignore +0 -1
- package/template-uni-app/.eslintrc +0 -16
- package/template-uni-app/.vscode/.server-controller-port.log +0 -5
- package/template-uni-app/.vscode/css.code-snippets +0 -398
- package/template-uni-app/.vscode/extensions.json +0 -12
- package/template-uni-app/.vscode/js.code-snippets +0 -1669
- package/template-uni-app/.vscode/settings.json +0 -25
- package/template-uni-app/.vscode/vue-html.code-snippets +0 -682
- package/template-uni-app/_env +0 -3
- package/template-uni-app/_env.development +0 -11
- package/template-uni-app/_env.production +0 -8
- package/template-uni-app/_env.test +0 -11
- package/template-uni-app/_gitignore +0 -3
- package/template-uni-app/_npmrc +0 -2
- package/template-uni-app/auto-imports.d.ts +0 -410
- package/template-uni-app/components.d.ts +0 -17
- package/template-uni-app/custom-plugins/index.ts +0 -8
- package/template-uni-app/custom-plugins/multiconf.ts +0 -74
- package/template-uni-app/custom-plugins/polyfill.ts +0 -32
- package/template-uni-app/dist/dev/mp-weixin/apis/index.js +0 -44
- package/template-uni-app/dist/dev/mp-weixin/apis/lib/index.js +0 -90
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +0 -10
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/index.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +0 -15
- package/template-uni-app/dist/dev/mp-weixin/app.js +0 -93
- package/template-uni-app/dist/dev/mp-weixin/app.json +0 -51
- package/template-uni-app/dist/dev/mp-weixin/app.wxss +0 -2378
- package/template-uni-app/dist/dev/mp-weixin/common/assets.js +0 -13
- package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +0 -10189
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.js +0 -22
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxml +0 -1
- 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 -22
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxml +0 -1
- 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 -82
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxss +0 -108
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +0 -56
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxss +0 -88
- package/template-uni-app/dist/dev/mp-weixin/config/enum.js +0 -21
- package/template-uni-app/dist/dev/mp-weixin/config/index.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/config/map.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +0 -30
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.json +0 -6
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxml +0 -1
- 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 -56
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.json +0 -9
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +0 -1
- 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 -98
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxss +0 -125
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +0 -38
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.json +0 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +0 -1
- 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 -51
- package/template-uni-app/dist/dev/mp-weixin/pages/index.json +0 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +0 -1
- 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 -22
- package/template-uni-app/dist/dev/mp-weixin/pages/my.json +0 -3
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +0 -1
- 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 -56
- 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 -8
- package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +0 -11
- package/template-uni-app/dist/dev/mp-weixin/store/system.js +0 -14
- package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +0 -82
- package/template-uni-app/dist/dev/mp-weixin/utils/route.js +0 -85
- package/template-uni-app/dist/dev/mp-weixin/utils/system.js +0 -27
- package/template-uni-app/index.html +0 -23
- package/template-uni-app/manifest.config.ts +0 -88
- package/template-uni-app/package.json +0 -109
- package/template-uni-app/pages.config.ts +0 -58
- package/template-uni-app/pnpm-lock.yaml +0 -9918
- package/template-uni-app/src/App.vue +0 -79
- package/template-uni-app/src/apis/index.ts +0 -54
- package/template-uni-app/src/apis/lib/index.ts +0 -235
- package/template-uni-app/src/apis/requests/get.ts +0 -52
- package/template-uni-app/src/apis/requests/index.ts +0 -8
- package/template-uni-app/src/apis/requests/post.ts +0 -23
- package/template-uni-app/src/components/young-loading/young-loading.vue +0 -36
- package/template-uni-app/src/components/young-loading-mini/young-loading-mini.vue +0 -35
- package/template-uni-app/src/components/young-navbar/young-navbar.vue +0 -252
- package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +0 -145
- package/template-uni-app/src/config/enum.ts +0 -47
- package/template-uni-app/src/config/index.ts +0 -8
- package/template-uni-app/src/config/map.ts +0 -15
- package/template-uni-app/src/env.d.ts +0 -36
- package/template-uni-app/src/layouts/default.vue +0 -22
- package/template-uni-app/src/layouts/tabbar.vue +0 -38
- package/template-uni-app/src/main.ts +0 -20
- package/template-uni-app/src/manifest.json +0 -75
- package/template-uni-app/src/pages/demo/index.vue +0 -30
- package/template-uni-app/src/pages/index.vue +0 -65
- package/template-uni-app/src/pages/my.vue +0 -30
- package/template-uni-app/src/pages.json +0 -74
- 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 +0 -16
- package/template-uni-app/src/store/local/index.ts +0 -42
- package/template-uni-app/src/store/system.ts +0 -21
- package/template-uni-app/src/typings/global.d.ts +0 -7
- package/template-uni-app/src/uni.scss +0 -76
- package/template-uni-app/src/utils/auth.ts +0 -204
- package/template-uni-app/src/utils/index.ts +0 -11
- package/template-uni-app/src/utils/map.ts +0 -98
- package/template-uni-app/src/utils/modal.ts +0 -120
- package/template-uni-app/src/utils/route.ts +0 -151
- package/template-uni-app/src/utils/system.ts +0 -67
- package/template-uni-app/tsconfig.json +0 -16
- package/template-uni-app/unocss.config.ts +0 -30
- package/template-uni-app/vite.config.ts +0 -64
- package/template-uni-app/volar.config.js +0 -6
- package/template-vue-mobile/.vscode/base.code-snippets +0 -24
- package/template-vue-mobile/.vscode/extensions.json +0 -10
- package/template-vue-mobile/.vscode/settings.json +0 -7
- package/template-vue-mobile/Dockerfile +0 -42
- package/template-vue-mobile/_env +0 -6
- package/template-vue-mobile/_gitignore +0 -30
- package/template-vue-mobile/boot.mjs +0 -16
- package/template-vue-mobile/build/custom-plugin.ts +0 -30
- package/template-vue-mobile/build/index.ts +0 -7
- package/template-vue-mobile/build/plugins.ts +0 -68
- package/template-vue-mobile/config/.devrc +0 -2
- package/template-vue-mobile/config/.onlinerc +0 -1
- package/template-vue-mobile/config/.testrc +0 -1
- package/template-vue-mobile/index.html +0 -25
- package/template-vue-mobile/nitro.config.ts +0 -19
- package/template-vue-mobile/package.json +0 -48
- package/template-vue-mobile/plugins/env.ts +0 -26
- package/template-vue-mobile/public/vite.svg +0 -1
- package/template-vue-mobile/rome.json +0 -24
- package/template-vue-mobile/routes/[...all].ts +0 -11
- package/template-vue-mobile/routes/get/env.ts +0 -25
- package/template-vue-mobile/src/App.vue +0 -29
- package/template-vue-mobile/src/auto-components.d.ts +0 -24
- package/template-vue-mobile/src/auto-imports.d.ts +0 -289
- package/template-vue-mobile/src/components/Init.vue +0 -36
- package/template-vue-mobile/src/global.d.ts +0 -7
- package/template-vue-mobile/src/hooks/useVerifyCode.ts +0 -46
- package/template-vue-mobile/src/layouts/blank.vue +0 -9
- package/template-vue-mobile/src/layouts/default.vue +0 -27
- package/template-vue-mobile/src/layouts/sub.vue +0 -20
- package/template-vue-mobile/src/main.ts +0 -35
- package/template-vue-mobile/src/modules/1-router.ts +0 -40
- package/template-vue-mobile/src/modules/2-pinia.ts +0 -10
- package/template-vue-mobile/src/modules/3-net.ts +0 -46
- package/template-vue-mobile/src/modules/4-auth.ts +0 -64
- package/template-vue-mobile/src/views/[...all_404].vue +0 -557
- package/template-vue-mobile/src/views/base/login.vue +0 -110
- package/template-vue-mobile/src/views/base/resetPasswd.vue +0 -88
- package/template-vue-mobile/src/views/index.vue +0 -18
- package/template-vue-mobile/src/views/my.vue +0 -15
- package/template-vue-mobile/src/views/sub.vue +0 -18
- package/template-vue-mobile/src/vite-env.d.ts +0 -43
- package/template-vue-mobile/tsconfig.json +0 -21
- package/template-vue-mobile/tsconfig.node.json +0 -9
- package/template-vue-mobile/unocss.config.ts +0 -47
- package/template-vue-mobile/vite.config.ts +0 -32
- package/template-vue-mobile/yarn.lock +0 -4395
- package/template-vue-thin/.vscode/extensions.json +0 -10
- package/template-vue-thin/.vscode/settings.json +0 -4
- package/template-vue-thin/_env +0 -1
- package/template-vue-thin/_gitignore +0 -29
- package/template-vue-thin/index.html +0 -21
- package/template-vue-thin/package.json +0 -40
- package/template-vue-thin/public/vite.svg +0 -1
- package/template-vue-thin/src/App.vue +0 -9
- package/template-vue-thin/src/layouts/blank.vue +0 -9
- package/template-vue-thin/src/layouts/default.vue +0 -12
- package/template-vue-thin/src/layouts/list.vue +0 -12
- package/template-vue-thin/src/main.ts +0 -58
- package/template-vue-thin/src/views/[...all_404].vue +0 -488
- package/template-vue-thin/src/views/index.vue +0 -19
- package/template-vue-thin/src/views/list.vue +0 -17
- package/template-vue-thin/src/vite-env.d.ts +0 -22
- package/template-vue-thin/tsconfig.json +0 -21
- package/template-vue-thin/tsconfig.node.json +0 -9
- package/template-vue-thin/unocss.config.ts +0 -47
- package/template-vue-thin/vite.config.ts +0 -64
@@ -1,145 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-07-25 16:45:39
|
4
|
-
* @LastEditTime: 2023-08-25 16:55:10
|
5
|
-
* @Description:
|
6
|
-
-->
|
7
|
-
<script lang="ts" setup>
|
8
|
-
import { YoungDialog, YoungPagination, YoungSearchForm, YoungTablePro } from '@bluesyoung/ui-vue3-element-plus'
|
9
|
-
import { useRoleApi, useRoleBase, useRoleMenu } from './hooks/useRole'
|
10
|
-
|
11
|
-
definePageMeta({
|
12
|
-
title: '角色管理',
|
13
|
-
})
|
14
|
-
|
15
|
-
const {
|
16
|
-
query,
|
17
|
-
queryScheme,
|
18
|
-
reset,
|
19
|
-
getList,
|
20
|
-
tableHead,
|
21
|
-
tableData,
|
22
|
-
baseFormRef,
|
23
|
-
base,
|
24
|
-
} = useRoleBase()
|
25
|
-
|
26
|
-
const { showPriority, menu } = useRoleMenu()
|
27
|
-
|
28
|
-
const { showApi, api } = useRoleApi()
|
29
|
-
|
30
|
-
useTabReOpen(getList)
|
31
|
-
</script>
|
32
|
-
|
33
|
-
<template>
|
34
|
-
<ElCard>
|
35
|
-
<YoungSearchForm v-model="query" :search-scheme="queryScheme" :on-search="getList" :on-reset="reset">
|
36
|
-
<template #btns>
|
37
|
-
<ElButton type="success" @click="base.isAdd = true">
|
38
|
-
添加角色
|
39
|
-
</ElButton>
|
40
|
-
</template>
|
41
|
-
</YoungSearchForm>
|
42
|
-
</ElCard>
|
43
|
-
|
44
|
-
<br>
|
45
|
-
|
46
|
-
<ElCard>
|
47
|
-
<YoungTablePro :table-data="tableData" :table-head="tableHead">
|
48
|
-
<template #operate>
|
49
|
-
<ElTableColumn label="操作" width="300px" fixed="right">
|
50
|
-
<template #default="scope">
|
51
|
-
<ElButton type="primary" link @click="base.edit(scope.row)">
|
52
|
-
信息编辑
|
53
|
-
</ElButton>
|
54
|
-
<ElButton type="primary" link @click="menu.edit(scope.row)">
|
55
|
-
菜单编辑
|
56
|
-
</ElButton>
|
57
|
-
<ElButton type="primary" link @click="api.edit(scope.row)">
|
58
|
-
接口编辑
|
59
|
-
</ElButton>
|
60
|
-
<ElButton type="danger" link @click="base.del(scope.row)">
|
61
|
-
删除
|
62
|
-
</ElButton>
|
63
|
-
</template>
|
64
|
-
</ElTableColumn>
|
65
|
-
</template>
|
66
|
-
</YoungTablePro>
|
67
|
-
<YoungPagination
|
68
|
-
v-model:page="query.pageNum" v-model:limit="query.pageSize" :total="query.total"
|
69
|
-
@page-change="getList"
|
70
|
-
/>
|
71
|
-
</ElCard>
|
72
|
-
<!-- 基础信息编辑 -->
|
73
|
-
<YoungDialog
|
74
|
-
:is-add="base.isAdd" :diff-form="base.form" :is-edit="base.isEdit" width="520px" @sure="base.sure"
|
75
|
-
@clear="base.clear"
|
76
|
-
>
|
77
|
-
<template #body>
|
78
|
-
<ElForm
|
79
|
-
ref="baseFormRef" :model="base.form" label-width="120px"
|
80
|
-
:label-position="WindowSize['lt-lg'] ? 'top' : 'left'"
|
81
|
-
>
|
82
|
-
<ElFormItem label="角色名称(中文)" prop="name" :rules="[{ required: true, message: '请填写角色名称', trigger: 'blur' }]">
|
83
|
-
<ElInput v-model.trim="base.form.name" class="!w-300px" />
|
84
|
-
</ElFormItem>
|
85
|
-
<ElFormItem label="关键字(英文)" prop="keyword" :rules="[{ required: true, message: '请填写关键字', trigger: 'blur' }]">
|
86
|
-
<ElInput v-model.trim="base.form.keyword" class="!w-300px" />
|
87
|
-
</ElFormItem>
|
88
|
-
<ElFormItem label="角色描述">
|
89
|
-
<ElInput v-model.trim="base.form.desc" class="!w-300px" />
|
90
|
-
</ElFormItem>
|
91
|
-
</ElForm>
|
92
|
-
</template>
|
93
|
-
</YoungDialog>
|
94
|
-
<!-- 菜单编辑 -->
|
95
|
-
<YoungDialog
|
96
|
-
real-title="菜单编辑" :diff-form="menu.checkMap" :is-edit="showPriority" top="5vh" width="1200px"
|
97
|
-
@sure="menu.sure" @clear="menu.clear"
|
98
|
-
>
|
99
|
-
<template #body>
|
100
|
-
<ElTable :data="menu.tableData" row-key="id" :default-expand-all="false" class="max-h-600px !overflow-y-auto">
|
101
|
-
<ElTableColumn prop="name" label="节点名称" width="320px">
|
102
|
-
<template #default="scope">
|
103
|
-
<ElCheckbox v-model="menu.checkMap[scope.row.id]" @change="menu.selectChange(scope.row)">
|
104
|
-
{{
|
105
|
-
scope.row.title
|
106
|
-
}}
|
107
|
-
</ElCheckbox>
|
108
|
-
</template>
|
109
|
-
</ElTableColumn>
|
110
|
-
<ElTableColumn v-for="(item, index) in menu.tableHead" v-bind="item" :key="`${index}fsdjhfaer`" />
|
111
|
-
<ElTableColumn prop="name" label="隐藏/显示">
|
112
|
-
<template #default="scope">
|
113
|
-
<ElSwitch
|
114
|
-
v-model="scope.row.visible" :active-value="1" :inactive-value="0" active-color="#409EFF"
|
115
|
-
inactive-color="#909399" disabled
|
116
|
-
/>
|
117
|
-
</template>
|
118
|
-
</ElTableColumn>
|
119
|
-
</ElTable>
|
120
|
-
</template>
|
121
|
-
</YoungDialog>
|
122
|
-
<!-- 接口编辑 -->
|
123
|
-
<YoungDialog
|
124
|
-
real-title="接口编辑" :diff-form="api.checkMap" :is-edit="showApi" top="5vh" width="1200px" @sure="api.sure"
|
125
|
-
@clear="api.clear"
|
126
|
-
>
|
127
|
-
<template #body>
|
128
|
-
<ElTable :data="api.tableData" row-key="id" :default-expand-all="false" class="max-h-600px !overflow-y-auto">
|
129
|
-
<ElTableColumn prop="name" width="100px">
|
130
|
-
<template #header>
|
131
|
-
<ElCheckbox v-model="api.isAll" @change="api.changeAll">
|
132
|
-
全选
|
133
|
-
</ElCheckbox>
|
134
|
-
</template>
|
135
|
-
<template #default="scope">
|
136
|
-
<ElCheckbox v-model="api.checkMap[scope.row.id]">
|
137
|
-
{{ scope.row.title }}
|
138
|
-
</ElCheckbox>
|
139
|
-
</template>
|
140
|
-
</ElTableColumn>
|
141
|
-
<ElTableColumn v-for="(item, index) in api.tableHead" v-bind="item" :key="`${index}fsdjhfaer`" />
|
142
|
-
</ElTable>
|
143
|
-
</template>
|
144
|
-
</YoungDialog>
|
145
|
-
</template>
|
@@ -1,225 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-07-25 16:46:00
|
4
|
-
* @LastEditTime: 2023-08-25 16:55:17
|
5
|
-
* @Description:
|
6
|
-
-->
|
7
|
-
<script lang="ts" setup>
|
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 } from 'element-plus'
|
12
|
-
|
13
|
-
definePageMeta({
|
14
|
-
title: '用户管理',
|
15
|
-
})
|
16
|
-
|
17
|
-
interface Form extends UserItem { op?: any };
|
18
|
-
const FORM_TEMP: Form = {
|
19
|
-
id: 0,
|
20
|
-
username: '',
|
21
|
-
nickname: '',
|
22
|
-
mobile: '',
|
23
|
-
roleId: 1,
|
24
|
-
status: 1,
|
25
|
-
initPassword: '',
|
26
|
-
}
|
27
|
-
const {
|
28
|
-
isAdd,
|
29
|
-
isEdit,
|
30
|
-
edit,
|
31
|
-
del,
|
32
|
-
sure,
|
33
|
-
clear,
|
34
|
-
form,
|
35
|
-
formRef,
|
36
|
-
validForm,
|
37
|
-
} = useFormMode<Form>(FORM_TEMP, {
|
38
|
-
addCbk: async () => {
|
39
|
-
const res = await validForm() as boolean
|
40
|
-
if (res) {
|
41
|
-
const v = deepClone(form.value)
|
42
|
-
await apis.post.addUserItem(v)
|
43
|
-
ElMessage.success('新增成功!')
|
44
|
-
}
|
45
|
-
return res
|
46
|
-
},
|
47
|
-
modCbk: async () => {
|
48
|
-
const res = await validForm() as boolean
|
49
|
-
if (res) {
|
50
|
-
const v = deepClone(form.value)
|
51
|
-
await apis.patch.changeUserItem(v)
|
52
|
-
ElMessage.success('修改成功!')
|
53
|
-
}
|
54
|
-
return res
|
55
|
-
},
|
56
|
-
delCbk: async (row) => {
|
57
|
-
await apis.delete.deleteUser(row.id.toString())
|
58
|
-
ElMessage.success('删除成功!')
|
59
|
-
query.value.pageNum = 1
|
60
|
-
},
|
61
|
-
cgEffect: () => getList(),
|
62
|
-
})
|
63
|
-
|
64
|
-
const tableHead: TableHeadItem<Form>[] = [
|
65
|
-
{ prop: 'id', label: '用户ID' },
|
66
|
-
{ prop: 'username', label: '用户名' },
|
67
|
-
{ prop: 'mobile', label: '手机号' },
|
68
|
-
{ prop: 'role_name', label: '角色名称' },
|
69
|
-
{ prop: 'creator', label: '创建信息' },
|
70
|
-
{
|
71
|
-
prop: 'op',
|
72
|
-
label: '操作',
|
73
|
-
width: '300px',
|
74
|
-
fixed: 'right',
|
75
|
-
render: row => h('div', [
|
76
|
-
hasPermission('/access/system/update/user') && h(ElButton, {
|
77
|
-
type: 'primary',
|
78
|
-
text: true,
|
79
|
-
class: '!p-0',
|
80
|
-
onClick: () => edit(row),
|
81
|
-
}, {
|
82
|
-
default: () => '编辑',
|
83
|
-
}),
|
84
|
-
hasPermission('/access/system/update/user') && h(ElButton, {
|
85
|
-
type: 'warning',
|
86
|
-
text: true,
|
87
|
-
class: '!p-0',
|
88
|
-
onClick: () => changePwd(row),
|
89
|
-
}, {
|
90
|
-
default: () => '修改密码',
|
91
|
-
}),
|
92
|
-
hasPermission('/access/system/del/user') && h(ElButton, {
|
93
|
-
type: 'danger',
|
94
|
-
text: true,
|
95
|
-
class: '!p-0',
|
96
|
-
onClick: () => del(row),
|
97
|
-
}, {
|
98
|
-
default: () => '删除',
|
99
|
-
}),
|
100
|
-
]),
|
101
|
-
},
|
102
|
-
]
|
103
|
-
const tableData = ref<TableDataItem<Form>[]>([])
|
104
|
-
|
105
|
-
async function getList() {
|
106
|
-
const { list: role_list } = await apis.get.getRoleList({ noPagination: true })
|
107
|
-
roleList.value = (role_list || []).map((item: RoleItem) => {
|
108
|
-
return {
|
109
|
-
label: item.name,
|
110
|
-
value: item.id,
|
111
|
-
}
|
112
|
-
})
|
113
|
-
|
114
|
-
const { list, pageNum, pageSize, total } = await apis.get.getUserList(query.value)
|
115
|
-
tableData.value = deepClone(list || [])
|
116
|
-
|
117
|
-
query.value.pageNum = +pageNum || 1
|
118
|
-
query.value.pageSize = +pageSize || 50
|
119
|
-
query.value.total = +total || 0
|
120
|
-
}
|
121
|
-
|
122
|
-
function changePwd(e: UserItem) {
|
123
|
-
ElMessageBox.prompt('请输入新密码').then(async ({ value }) => {
|
124
|
-
value = value.trim()
|
125
|
-
if (value) {
|
126
|
-
await apis.patch.changeUserItem({ id: e.id, newPassword: value })
|
127
|
-
ElMessage.success('修改成功!')
|
128
|
-
}
|
129
|
-
}).catch(() => null)
|
130
|
-
}
|
131
|
-
|
132
|
-
interface Query extends BaseQuery {
|
133
|
-
username: string
|
134
|
-
mobile: string
|
135
|
-
status: 0 | 1
|
136
|
-
}
|
137
|
-
|
138
|
-
const { query, reset } = useQuery<Query>(
|
139
|
-
{
|
140
|
-
pageNum: 1,
|
141
|
-
pageSize: 10,
|
142
|
-
total: 0,
|
143
|
-
username: '',
|
144
|
-
mobile: '',
|
145
|
-
status: 1,
|
146
|
-
},
|
147
|
-
getList,
|
148
|
-
)
|
149
|
-
const queryScheme: YoungSearchScheme<Query> = {
|
150
|
-
username: {
|
151
|
-
type: 'input',
|
152
|
-
tip: '用户名',
|
153
|
-
attrs: {
|
154
|
-
placeholder: '请输入用户名',
|
155
|
-
},
|
156
|
-
},
|
157
|
-
mobile: {
|
158
|
-
type: 'input',
|
159
|
-
tip: '手机号',
|
160
|
-
attrs: {
|
161
|
-
placeholder: '请输入手机号',
|
162
|
-
maxlength: 11,
|
163
|
-
},
|
164
|
-
},
|
165
|
-
status: {
|
166
|
-
type: 'select',
|
167
|
-
tip: '状态',
|
168
|
-
attrs: {
|
169
|
-
placeholder: '用户状态',
|
170
|
-
},
|
171
|
-
options: [{ label: '禁用', value: 0 }, { label: '启用', value: 1 }],
|
172
|
-
},
|
173
|
-
}
|
174
|
-
|
175
|
-
const roleList = ref<SelectOptionItem<number>[]>([])
|
176
|
-
|
177
|
-
useTabReOpen(getList)
|
178
|
-
</script>
|
179
|
-
|
180
|
-
<template>
|
181
|
-
<ElCard>
|
182
|
-
<YoungSearchForm v-model="query" :search-scheme="queryScheme" :on-search="getList" :on-reset="reset">
|
183
|
-
<template #btns>
|
184
|
-
<ElButton v-permission="'/access/system/create/user'" type="success" @click="isAdd = true">
|
185
|
-
添加用户
|
186
|
-
</ElButton>
|
187
|
-
</template>
|
188
|
-
</YoungSearchForm>
|
189
|
-
</ElCard>
|
190
|
-
|
191
|
-
<br>
|
192
|
-
|
193
|
-
<ElCard>
|
194
|
-
<YoungTablePro :table-data="tableData" :table-head="tableHead" />
|
195
|
-
<YoungPagination
|
196
|
-
v-model:page="query.pageNum" v-model:limit="query.pageSize" :total="query.total"
|
197
|
-
@page-change="getList"
|
198
|
-
/>
|
199
|
-
</ElCard>
|
200
|
-
|
201
|
-
<YoungDialog :is-add="isAdd" :diff-form="form" :is-edit="isEdit" width="520px" @sure="sure" @clear="clear">
|
202
|
-
<template #body>
|
203
|
-
<ElForm ref="formRef" :model="form" label-width="100px" :label-position="WindowSize['lt-lg'] ? 'top' : 'left'">
|
204
|
-
<ElFormItem label="用户名" prop="username" :rules="{ required: true, message: '请输用户名', trigger: 'blur' }">
|
205
|
-
<ElInput v-model.trim="form.username" class="!w-300px" />
|
206
|
-
</ElFormItem>
|
207
|
-
<ElFormItem label="昵称" prop="nickname" :rules="{ required: true, message: '请输昵称(用于右上角展示)', trigger: 'blur' }">
|
208
|
-
<ElInput v-model.trim="form.nickname" class="!w-300px" />
|
209
|
-
</ElFormItem>
|
210
|
-
<ElFormItem label="手机号" prop="mobile" :rules="{ required: true, message: '请输手机号', trigger: 'blur' }">
|
211
|
-
<ElInput v-model.trim="form.mobile" :maxlength="11" class="!w-300px" />
|
212
|
-
</ElFormItem>
|
213
|
-
<ElFormItem label="角色">
|
214
|
-
<YoungSelect v-model="form.roleId" placeholder="请选择角色" :options="roleList" />
|
215
|
-
</ElFormItem>
|
216
|
-
<ElFormItem
|
217
|
-
v-if="isAdd" label="初始密码" prop="initPassword"
|
218
|
-
:rules="{ required: true, message: '请输初始密码', trigger: 'blur' }"
|
219
|
-
>
|
220
|
-
<ElInput v-model.trim="form.initPassword" class="!w-300px" />
|
221
|
-
</ElFormItem>
|
222
|
-
</ElForm>
|
223
|
-
</template>
|
224
|
-
</YoungDialog>
|
225
|
-
</template>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-07-31 14:04:44
|
4
|
-
* @LastEditTime: 2023-07-31 14:33:10
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
import { isString } from '@bluesyoung/utils'
|
8
|
-
|
9
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
10
|
-
/**
|
11
|
-
* 鉴自指令定义的zdy
|
12
|
-
*/
|
13
|
-
nuxtApp.vueApp.directive('permission', {
|
14
|
-
mounted(el, binding) {
|
15
|
-
const { value } = binding
|
16
|
-
|
17
|
-
if (isString(value) && value) {
|
18
|
-
if (!hasPermission(value as unknown as string))
|
19
|
-
el.parentNode && el.parentNode.removeChild(el)
|
20
|
-
}
|
21
|
-
else {
|
22
|
-
throw new Error('need value! Like v-permission="\'/access/get/list\'"')
|
23
|
-
}
|
24
|
-
},
|
25
|
-
})
|
26
|
-
})
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M28.717511 509.428622c0.068267 263.850667 213.8112 477.684622 477.411556 477.639111 263.600356-0.045511 477.275022-213.970489 477.229511-477.843911 0-263.850667-213.720178-477.752889-477.320534-477.752889-126.611911 0-248.035556 50.3808-337.555911 140.014934a478.094222 478.094222 0 0 0-139.764622 337.92z" fill="#FFFFFF" /><path d="M856.814933 833.9456c-12.811378-67.1744-130.753422-131.390578-236.612266-166.479644-5.165511-1.729422-37.387378-16.201956-17.2032-77.459912 52.747378-54.0672 92.728889-141.175467 92.728889-226.941155 0-131.754667-87.699911-200.886044-189.622045-200.886045-101.944889 0-189.394489 69.063111-189.394489 200.886045 0 86.038756 40.004267 173.488356 92.842667 227.487289 20.593778 53.976178-16.224711 74.092089-23.984356 76.777244-100.693333 36.340622-217.679644 100.784356-230.559289 166.479645a478.685867 478.685867 0 0 1-55.591822-574.350223 477.639111 477.639111 0 0 1 536.9856-209.942755C842.183111 107.633778 984.314311 295.5264 984.450844 509.5424a475.363556 475.363556 0 0 1-127.635911 324.4032" fill="#B8D4FF" /></svg>
|
@@ -1,2 +0,0 @@
|
|
1
|
-
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><path fill="#666" d="M26 2h4v4h-4zm0 6h4v4h-4zm-6-6h4v4h-4zm0 6h4v4h-4z"/><path fill="#666" d="M28 16v6H4V6h12V4H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8v4H8v2h16v-2h-4v-4h8a2 2 0 0 0 2-2v-6ZM18 28h-4v-4h4Z"/></svg>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgb(255, 255, 255); display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
|
3
|
-
<rect x="17.5" y="30" width="15" height="40" fill="#93dbe9">
|
4
|
-
<animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="18;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.2s"></animate>
|
5
|
-
<animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="64;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.2s"></animate>
|
6
|
-
</rect>
|
7
|
-
<rect x="42.5" y="30" width="15" height="40" fill="#689cc5">
|
8
|
-
<animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="20.999999999999996;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.1s"></animate>
|
9
|
-
<animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="58.00000000000001;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.1s"></animate>
|
10
|
-
</rect>
|
11
|
-
<rect x="67.5" y="30" width="15" height="40" fill="#5e6fa3">
|
12
|
-
<animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="20.999999999999996;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1"></animate>
|
13
|
-
<animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="58.00000000000001;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1"></animate>
|
14
|
-
</rect>
|
15
|
-
<!-- [ldio] generated by https://loading.io/ --></svg>
|
@@ -1,2 +0,0 @@
|
|
1
|
-
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><path fill="#fff" d="M26 2h4v4h-4zm0 6h4v4h-4zm-6-6h4v4h-4zm0 6h4v4h-4z"/><path fill="#fff" d="M28 16v6H4V6h12V4H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8v4H8v2h16v-2h-4v-4h8a2 2 0 0 0 2-2v-6ZM18 28h-4v-4h4Z"/></svg>
|
Binary file
|
@@ -1,10 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-07-21 09:50:36
|
4
|
-
* @LastEditTime: 2023-07-21 09:50:36
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
export default eventHandler(async (event) => {
|
8
|
-
const proxy = createTransparentProxy(process.env.NUXT_PUBLIC_API_BASE as string)
|
9
|
-
await proxy.handle(event)
|
10
|
-
})
|
@@ -1,87 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2022-12-30 17:19:42
|
4
|
-
* @LastEditTime: 2023-09-16 16:27:56
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
import { resolve } from 'node:path'
|
8
|
-
import { loadConfig } from 'c12'
|
9
|
-
import { useYoungLogger } from '@bluesyoung/logger'
|
10
|
-
|
11
|
-
export default defineNitroPlugin(async (nitroApp) => {
|
12
|
-
const env = (process.env.DEPLOY_ENV as 'dev' | 'test' | 'online') || 'dev'
|
13
|
-
const { config } = await loadConfig<Record<string, any>>({
|
14
|
-
name: env,
|
15
|
-
cwd: resolve(process.cwd(), 'config'),
|
16
|
-
defaultConfig: {
|
17
|
-
// 此处可以放置通用的环境变量
|
18
|
-
// 由于频繁修改 package.json 会浪费 docker 性能,故将版本信息放于此处
|
19
|
-
// 优先读取环境变量中的版本信息(自己打的 Tag)
|
20
|
-
NUXT_PUBLIC_CURRENT_VERSION: process.env.PROJECT_VERSION || 'v0.0.1',
|
21
|
-
|
22
|
-
NUXT_PUBLIC_TITLE: 'XXX-后台管理系统',
|
23
|
-
NUXT_PUBLIC_SUB_TITLE: '做XXX我们是认真的!',
|
24
|
-
NUXT_PUBLIC_SLOGAN: 'XXXXX, XXXXX',
|
25
|
-
NUXT_PUBLIC_LOGIN_BG: '/bg.webp',
|
26
|
-
NUXT_PUBLIC_LOGIN_LOGO: '/logo.svg',
|
27
|
-
},
|
28
|
-
})
|
29
|
-
|
30
|
-
for (const key in config) {
|
31
|
-
if (process.env[key]) {
|
32
|
-
console.log(
|
33
|
-
'系统环境变量优先: ',
|
34
|
-
key,
|
35
|
-
' = ',
|
36
|
-
process.env[key],
|
37
|
-
' -> ',
|
38
|
-
config[key],
|
39
|
-
' -> ',
|
40
|
-
'覆盖',
|
41
|
-
)
|
42
|
-
config[key] = process.env[key]
|
43
|
-
}
|
44
|
-
else {
|
45
|
-
process.env[key] = config[key]
|
46
|
-
}
|
47
|
-
if (!(key.indexOf('NUXT_PUBLIC_') === 0))
|
48
|
-
delete config[key]
|
49
|
-
}
|
50
|
-
|
51
|
-
console.log('------------------------读取配置文件------------------------')
|
52
|
-
console.log(config)
|
53
|
-
console.log('-------------------------------------------------------------')
|
54
|
-
|
55
|
-
// 仅打包之后格式化日志
|
56
|
-
if (process.env.NODE_ENV !== 'development')
|
57
|
-
useYoungLogger()
|
58
|
-
|
59
|
-
nitroApp.hooks.hook('render:html', (html, { event }) => {
|
60
|
-
// 直接注入环境变量到前端
|
61
|
-
html.bodyPrepend.push(`
|
62
|
-
<!-- 注入环境变量 -->
|
63
|
-
<script>window.__YOUNG_ENV__=${JSON.stringify(config)}</script>
|
64
|
-
<!-- 更新检测,每分钟一次 -->
|
65
|
-
<script>
|
66
|
-
setInterval(() => {
|
67
|
-
fetch('/get/env')
|
68
|
-
.then((res) => res.json())
|
69
|
-
.then(({ NUXT_PUBLIC_CURRENT_VERSION }) => {
|
70
|
-
if (NUXT_PUBLIC_CURRENT_VERSION !== window.__YOUNG_ENV__.NUXT_PUBLIC_CURRENT_VERSION) {
|
71
|
-
alert('版本已更新,请重新加载页面!');
|
72
|
-
window.location.reload();
|
73
|
-
}
|
74
|
-
});
|
75
|
-
}, 6e4);
|
76
|
-
</script>
|
77
|
-
`)
|
78
|
-
|
79
|
-
// 移动端调试控制台,需要使用就放开下面的注释
|
80
|
-
// if (process.env.NODE_ENV === 'development' || process.env.NUXT_PUBLIC_ENABLE_CONSOLE) {
|
81
|
-
// html.bodyAppend.push(`
|
82
|
-
// <script src="//cdn.bootcdn.net/ajax/libs/eruda/2.3.3/eruda.js"></script>
|
83
|
-
// <script>eruda.init();</script>
|
84
|
-
// `);
|
85
|
-
// }
|
86
|
-
})
|
87
|
-
})
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-07-20 19:48:12
|
4
|
-
* @LastEditTime: 2023-07-21 11:18:40
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
export default defineEventHandler(async (event) => {
|
8
|
-
const envObj = {
|
9
|
-
NUXT_PUBLIC_CURRENT_VERSION: process.env.PROJECT_VERSION || 'v0.0.1',
|
10
|
-
}
|
11
|
-
|
12
|
-
return envObj
|
13
|
-
})
|
@@ -1,36 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* @Author: zhangyang
|
3
|
-
* @Date: 2023-05-29 10:29:52
|
4
|
-
* @LastEditTime: 2023-06-17 16:20:40
|
5
|
-
* @Description:
|
6
|
-
*/
|
7
|
-
import { type ServerOptions as HTTPProxyOptions } from 'http-proxy'
|
8
|
-
import ProxyModule from 'http-proxy'
|
9
|
-
import type { H3Event } from 'h3'
|
10
|
-
|
11
|
-
/**
|
12
|
-
* @param target 接口代理的具体地址
|
13
|
-
* @param defaults 代理配置
|
14
|
-
* @example
|
15
|
-
* export default defineEventHandler(async (event) => {
|
16
|
-
* const proxy = createTransparentProxy(`http://127.0.0.1:3333`);
|
17
|
-
* await proxy.handle(event);
|
18
|
-
* });
|
19
|
-
*/
|
20
|
-
export function createTransparentProxy(target: string, defaults: HTTPProxyOptions = {}) {
|
21
|
-
const proxy = ProxyModule.createProxy()
|
22
|
-
const handle = (event: H3Event, opts: HTTPProxyOptions = {}) => {
|
23
|
-
return new Promise<void>((resolve, reject) => {
|
24
|
-
proxy.web(event.node.req, event.node.res, { target, ...defaults, ...opts }, (error: any) => {
|
25
|
-
if (error.code !== 'ECONNRESET')
|
26
|
-
reject(error)
|
27
|
-
|
28
|
-
resolve()
|
29
|
-
})
|
30
|
-
})
|
31
|
-
}
|
32
|
-
return {
|
33
|
-
proxy,
|
34
|
-
handle,
|
35
|
-
}
|
36
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
// el-table 样式
|
2
|
-
.el-table {
|
3
|
-
-webkit-box-flex: 1;
|
4
|
-
-webkit-flex: 1;
|
5
|
-
-ms-flex: 1;
|
6
|
-
flex: 1;
|
7
|
-
|
8
|
-
table {
|
9
|
-
width: 100%;
|
10
|
-
}
|
11
|
-
|
12
|
-
.el-table__header th {
|
13
|
-
font-weight: bold;
|
14
|
-
color: var(--el-text-color-primary);
|
15
|
-
background: var(--el-fill-color-light) !important;
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
// el-dialog 样式
|
20
|
-
.el-dialog {
|
21
|
-
.el-dialog__header {
|
22
|
-
padding: 15px 20px;
|
23
|
-
margin: 0;
|
24
|
-
border-bottom: 1px solid var(--el-border-color-lighter);
|
25
|
-
|
26
|
-
.el-dialog__title {
|
27
|
-
font-size: 17px;
|
28
|
-
}
|
29
|
-
}
|
30
|
-
}
|
@@ -1,59 +0,0 @@
|
|
1
|
-
@import './element.scss';
|
2
|
-
|
3
|
-
// 滚动条样式
|
4
|
-
@mixin base-scrollbar {
|
5
|
-
&::-webkit-scrollbar {
|
6
|
-
width: 13px;
|
7
|
-
height: 13px;
|
8
|
-
}
|
9
|
-
|
10
|
-
&::-webkit-scrollbar-thumb {
|
11
|
-
background-color: rgb(0 0 0 / 10%);
|
12
|
-
background-clip: padding-box;
|
13
|
-
border: 3px solid transparent;
|
14
|
-
border-radius: 7px;
|
15
|
-
}
|
16
|
-
|
17
|
-
&::-webkit-scrollbar-thumb:hover {
|
18
|
-
background-color: rgb(0 0 0 / 30%);
|
19
|
-
}
|
20
|
-
|
21
|
-
&::-webkit-scrollbar-track {
|
22
|
-
background-color: transparent;
|
23
|
-
}
|
24
|
-
|
25
|
-
&::-webkit-scrollbar-track:hover {
|
26
|
-
background-color: #f8fafc;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
html body,
|
31
|
-
#__nuxt {
|
32
|
-
position: relative;
|
33
|
-
-webkit-box-sizing: border-box;
|
34
|
-
box-sizing: border-box;
|
35
|
-
height: 100vh;
|
36
|
-
padding: 0;
|
37
|
-
overflow: auto;
|
38
|
-
font-family: 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif;
|
39
|
-
font-size: 14px;
|
40
|
-
color: var(--el-color-black);
|
41
|
-
background: #f6f8f9;
|
42
|
-
-webkit-font-smoothing: antialiased;
|
43
|
-
@include base-scrollbar;
|
44
|
-
|
45
|
-
div {
|
46
|
-
@include base-scrollbar;
|
47
|
-
}
|
48
|
-
|
49
|
-
.layout-admin-wrapper {
|
50
|
-
.app-main-container {
|
51
|
-
@include base-scrollbar;
|
52
|
-
}
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
:root {
|
57
|
-
--el-color-white: #fff;
|
58
|
-
--el-color-grey: rgb(0 0 0 / 65%);
|
59
|
-
}
|