create-young-proj 1.0.0 → 1.1.0-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.editorconfig +14 -0
- package/.vscode/settings.json +39 -0
- package/CHANGELOG.md +256 -0
- package/README.md +7 -3
- package/build.config.ts +22 -0
- package/eslint.config.js +35 -0
- package/package.json +1 -7
- package/src/index.ts +366 -0
- package/template-admin-server/.editorconfig +11 -0
- package/template-admin-server/.nvmrc +1 -0
- package/template-admin-server/.vscode/extensions.json +6 -0
- package/template-admin-server/.vscode/settings.json +4 -0
- package/template-admin-server/_gitignore +15 -0
- package/template-admin-server/_nvmrc +1 -0
- package/template-admin-server/boot.mjs +11 -0
- package/template-admin-server/package.json +60 -0
- package/template-admin-server/rome.json +22 -0
- package/template-admin-server/src/config/config.default.ts +56 -0
- package/template-admin-server/src/configuration.ts +47 -0
- package/template-admin-server/src/controller/admin.controller.ts +397 -0
- package/template-admin-server/src/controller/api.controller.ts +98 -0
- package/template-admin-server/src/controller/base.controller.ts +70 -0
- package/template-admin-server/src/controller/dto/api.ts +47 -0
- package/template-admin-server/src/controller/dto/index.ts +36 -0
- package/template-admin-server/src/controller/dto/menu.ts +41 -0
- package/template-admin-server/src/controller/dto/role.ts +41 -0
- package/template-admin-server/src/controller/dto/user.ts +52 -0
- package/template-admin-server/src/controller/menu.controller.ts +138 -0
- package/template-admin-server/src/controller/role.controller.ts +116 -0
- package/template-admin-server/src/controller/user.controller.ts +108 -0
- package/template-admin-server/src/entities/Api.ts +29 -0
- package/template-admin-server/src/entities/BaseCreate.ts +30 -0
- package/template-admin-server/src/entities/Menu.ts +39 -0
- package/template-admin-server/src/entities/Role.ts +36 -0
- package/template-admin-server/src/entities/User.ts +35 -0
- package/template-admin-server/src/entities/index.ts +10 -0
- package/template-admin-server/src/filter/default.filter.ts +22 -0
- package/template-admin-server/src/filter/notfound.filter.ts +23 -0
- package/template-admin-server/src/middleware/helper.middleware.ts +28 -0
- package/template-admin-server/src/middleware/index.ts +9 -0
- package/template-admin-server/src/middleware/jwt.middleware.ts +32 -0
- package/template-admin-server/src/middleware/report.middleware.ts +26 -0
- package/template-admin-server/src/service/api.service.ts +174 -0
- package/template-admin-server/src/service/basic.ts +118 -0
- package/template-admin-server/src/service/index.ts +10 -0
- package/template-admin-server/src/service/menu.service.ts +139 -0
- package/template-admin-server/src/service/role.service.ts +286 -0
- package/template-admin-server/src/service/user.service.ts +124 -0
- package/template-admin-server/src/strategy/jwt.strategy.ts +26 -0
- package/template-admin-server/src/types/index.ts +42 -0
- package/template-admin-server/src/types/types.d.ts +31 -0
- package/template-admin-server/tsconfig.json +24 -0
- package/template-nuxt-admin/.vscode/extensions.json +12 -0
- package/template-nuxt-admin/.vscode/settings.json +39 -0
- package/template-nuxt-admin/Dockerfile +41 -0
- package/template-nuxt-admin/_gitignore +23 -0
- package/template-nuxt-admin/_npmrc +2 -0
- package/template-nuxt-admin/_nvmrc +1 -0
- package/template-nuxt-admin/app.vue +49 -0
- package/template-nuxt-admin/boot.mjs +16 -0
- package/template-nuxt-admin/components/ScreenFull.vue +19 -0
- package/template-nuxt-admin/components/TopSearch.vue +76 -0
- package/template-nuxt-admin/components/TopUser.vue +72 -0
- package/template-nuxt-admin/components/YoungChangePassword.vue +94 -0
- package/template-nuxt-admin/components/YoungCodeInput.vue +65 -0
- package/template-nuxt-admin/components/YoungEditor.vue +81 -0
- package/template-nuxt-admin/components/YoungLink.vue +24 -0
- package/template-nuxt-admin/components/YoungLoading.vue +39 -0
- package/template-nuxt-admin/components/ZenMode.vue +21 -0
- package/template-nuxt-admin/components/layout/Footer.vue +29 -0
- package/template-nuxt-admin/components/layout/Logo.vue +54 -0
- package/template-nuxt-admin/components/layout/Main.vue +26 -0
- package/template-nuxt-admin/components/layout/NavBar.vue +90 -0
- package/template-nuxt-admin/components/layout/SideBar.vue +96 -0
- package/template-nuxt-admin/components/layout/SubMenu.vue +52 -0
- package/template-nuxt-admin/components/layout/TabsBar.vue +184 -0
- package/template-nuxt-admin/composables/api.ts +97 -0
- package/template-nuxt-admin/composables/apis/delete.ts +37 -0
- package/template-nuxt-admin/composables/apis/get.ts +83 -0
- package/template-nuxt-admin/composables/apis/index.ts +10 -0
- package/template-nuxt-admin/composables/apis/patch.ts +74 -0
- package/template-nuxt-admin/composables/apis/post.ts +85 -0
- package/template-nuxt-admin/composables/config.ts +13 -0
- package/template-nuxt-admin/composables/icon.ts +25 -0
- package/template-nuxt-admin/composables/nav.ts +85 -0
- package/template-nuxt-admin/composables/tags.ts +136 -0
- package/template-nuxt-admin/composables/user.ts +48 -0
- package/template-nuxt-admin/config/.devrc +1 -0
- package/template-nuxt-admin/config/.onlinerc +1 -0
- package/template-nuxt-admin/config/.testrc +1 -0
- package/template-nuxt-admin/env.d.ts +47 -0
- package/template-nuxt-admin/error.vue +61 -0
- package/template-nuxt-admin/eslint.config.js +33 -0
- package/template-nuxt-admin/layouts/blank.vue +9 -0
- package/template-nuxt-admin/layouts/default.vue +163 -0
- package/template-nuxt-admin/middleware/auth.global.ts +66 -0
- package/template-nuxt-admin/nuxt.config.ts +106 -0
- package/template-nuxt-admin/package.json +63 -0
- package/template-nuxt-admin/pages/home/[id].vue +28 -0
- package/template-nuxt-admin/pages/index.vue +15 -0
- package/template-nuxt-admin/pages/login.vue +199 -0
- package/template-nuxt-admin/pages/system/api.vue +177 -0
- package/template-nuxt-admin/pages/system/hooks/useRole.ts +328 -0
- package/template-nuxt-admin/pages/system/menuList.vue +351 -0
- package/template-nuxt-admin/pages/system/role.vue +144 -0
- package/template-nuxt-admin/pages/system/user.vue +223 -0
- package/template-nuxt-admin/plugins/directive.ts +26 -0
- package/template-nuxt-admin/public/bg.webp +0 -0
- package/template-nuxt-admin/public/default_avatar.svg +1 -0
- package/template-nuxt-admin/public/favicon.svg +2 -0
- package/template-nuxt-admin/public/image_placeholder.svg +15 -0
- package/template-nuxt-admin/public/index.umd.js +74 -0
- package/template-nuxt-admin/public/index.umd.js.map +1 -0
- package/template-nuxt-admin/public/logo.svg +2 -0
- package/template-nuxt-admin/public/tabbar_bg.png +0 -0
- package/template-nuxt-admin/server/api/[...all].ts +10 -0
- package/template-nuxt-admin/server/plugins/env.ts +88 -0
- package/template-nuxt-admin/server/routes/get/env.ts +13 -0
- package/template-nuxt-admin/server/tsconfig.json +3 -0
- package/template-nuxt-admin/server/utils/index.ts +36 -0
- package/template-nuxt-admin/styles/element.scss +30 -0
- package/template-nuxt-admin/styles/index.scss +59 -0
- package/template-nuxt-admin/styles/variable.scss +103 -0
- package/template-nuxt-admin/tsconfig.json +7 -0
- package/template-nuxt-admin/typings/global.d.ts +16 -0
- package/template-nuxt-admin/typings/system.d.ts +67 -0
- package/template-nuxt-admin/typings/user.d.ts +19 -0
- package/template-nuxt-admin/uno.config.ts +40 -0
- package/template-nuxt-admin/utils/tool.ts +195 -0
- package/template-nuxt-admin/yarn.lock +8398 -0
- package/template-nuxt-website/.nvmrc +1 -0
- package/template-nuxt-website/.vscode/extensions.json +12 -0
- package/template-nuxt-website/.vscode/settings.json +39 -0
- package/template-nuxt-website/Dockerfile +41 -0
- package/template-nuxt-website/_gitignore +26 -0
- package/template-nuxt-website/_npmrc +2 -0
- package/template-nuxt-website/_nvmrc +1 -0
- package/template-nuxt-website/app.vue +66 -0
- package/template-nuxt-website/assets/tabbar/event.png +0 -0
- package/template-nuxt-website/assets/tabbar/event_active.png +0 -0
- package/template-nuxt-website/assets/tabbar/game.png +0 -0
- package/template-nuxt-website/assets/tabbar/game_active.png +0 -0
- package/template-nuxt-website/assets/tabbar/shop.png +0 -0
- package/template-nuxt-website/assets/tabbar/shop_active.png +0 -0
- package/template-nuxt-website/assets/tabbar/user.png +0 -0
- package/template-nuxt-website/assets/tabbar/user_active.png +0 -0
- package/template-nuxt-website/boot.mjs +16 -0
- package/template-nuxt-website/components/AboutNav.vue +27 -0
- package/template-nuxt-website/components/BreadNav.vue +35 -0
- package/template-nuxt-website/components/Follow.vue +48 -0
- package/template-nuxt-website/components/FriendLink.vue +36 -0
- package/template-nuxt-website/components/mobile/NavBar.vue +50 -0
- package/template-nuxt-website/components/top/Extra.vue +50 -0
- package/template-nuxt-website/components/top/Nav.vue +87 -0
- package/template-nuxt-website/components/young/Banner.vue +100 -0
- package/template-nuxt-website/components/young/Footer.vue +44 -0
- package/template-nuxt-website/components/young/Header.vue +25 -0
- package/template-nuxt-website/components/young/Tabbar.vue +76 -0
- package/template-nuxt-website/composables/ad.ts +20 -0
- package/template-nuxt-website/composables/config.ts +11 -0
- package/template-nuxt-website/composables/nav.ts +30 -0
- package/template-nuxt-website/composables/share.ts +22 -0
- package/template-nuxt-website/composables/utils.ts +84 -0
- package/template-nuxt-website/config/.devrc +11 -0
- package/template-nuxt-website/config/.onlinerc +13 -0
- package/template-nuxt-website/config/.testrc +11 -0
- package/template-nuxt-website/env.d.ts +55 -0
- package/template-nuxt-website/error.vue +69 -0
- package/template-nuxt-website/eslint.config.js +34 -0
- package/template-nuxt-website/layouts/default.vue +80 -0
- package/template-nuxt-website/layouts/home.vue +75 -0
- package/template-nuxt-website/layouts/tabbar.vue +78 -0
- package/template-nuxt-website/nuxt.config.ts +98 -0
- package/template-nuxt-website/package.json +41 -0
- package/template-nuxt-website/pages/index.html.vue +16 -0
- package/template-nuxt-website/pages/index.vue +29 -0
- package/template-nuxt-website/pages/match.html.vue +23 -0
- package/template-nuxt-website/pages/news/[id].html.vue +57 -0
- package/template-nuxt-website/pages/news.html.vue +26 -0
- package/template-nuxt-website/pages/shop.html.vue +26 -0
- package/template-nuxt-website/public/favicon.ico +0 -0
- package/template-nuxt-website/public/robots.txt +2 -0
- package/template-nuxt-website/public/svg/image_placeholder.svg +15 -0
- package/template-nuxt-website/server/api/get_footer_info.get.ts +52 -0
- package/template-nuxt-website/server/api/get_gray_status.get.ts +38 -0
- package/template-nuxt-website/server/api/get_head_nav.get.ts +38 -0
- package/template-nuxt-website/server/api/get_home_banner.get.ts +28 -0
- package/template-nuxt-website/server/api/get_seo_info.get.ts +32 -0
- package/template-nuxt-website/server/middleware/platform.ts +11 -0
- package/template-nuxt-website/server/plugins/init.ts +147 -0
- package/template-nuxt-website/server/tsconfig.json +3 -0
- package/template-nuxt-website/server/utils/index.ts +12 -0
- package/template-nuxt-website/server/utils/proxy.ts +59 -0
- package/template-nuxt-website/tsconfig.json +4 -0
- package/template-nuxt-website/typings/banner.d.ts +30 -0
- package/template-nuxt-website/typings/nav.d.ts +34 -0
- package/template-nuxt-website/typings/system.d.ts +22 -0
- package/template-nuxt-website/uno.config.ts +40 -0
- package/template-nuxt-website/utils/tool.ts +171 -0
- package/template-nuxt-website/yarn.lock +8018 -0
- package/template-uni-app/.eslintignore +1 -0
- package/template-uni-app/.eslintrc +16 -0
- package/template-uni-app/.vscode/css.code-snippets +398 -0
- package/template-uni-app/.vscode/extensions.json +12 -0
- package/template-uni-app/.vscode/js.code-snippets +1669 -0
- package/template-uni-app/.vscode/settings.json +39 -0
- package/template-uni-app/.vscode/vue-html.code-snippets +682 -0
- package/template-uni-app/_env +3 -0
- package/template-uni-app/_env.development +11 -0
- package/template-uni-app/_env.production +8 -0
- package/template-uni-app/_env.test +11 -0
- package/template-uni-app/_gitignore +3 -0
- package/template-uni-app/_npmrc +2 -0
- package/template-uni-app/_nvmrc +1 -0
- package/template-uni-app/auto-imports.d.ts +413 -0
- package/template-uni-app/components.d.ts +17 -0
- package/template-uni-app/custom-plugins/index.ts +7 -0
- package/template-uni-app/custom-plugins/multiconf.ts +74 -0
- package/template-uni-app/eslint.config.js +35 -0
- package/template-uni-app/index.html +23 -0
- package/template-uni-app/manifest.config.ts +88 -0
- package/template-uni-app/package.json +109 -0
- package/template-uni-app/pages.config.ts +58 -0
- package/template-uni-app/pnpm-lock.yaml +10981 -0
- package/template-uni-app/src/App.vue +79 -0
- package/template-uni-app/src/apis/index.ts +54 -0
- package/template-uni-app/src/apis/requests/get.ts +52 -0
- package/template-uni-app/src/apis/requests/index.ts +8 -0
- package/template-uni-app/src/apis/requests/post.ts +23 -0
- package/template-uni-app/src/components/young-loading/young-loading.vue +36 -0
- package/template-uni-app/src/components/young-loading-mini/young-loading-mini.vue +35 -0
- package/template-uni-app/src/components/young-navbar/young-navbar.vue +252 -0
- package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +145 -0
- package/template-uni-app/src/config/enum.ts +47 -0
- package/template-uni-app/src/config/index.ts +8 -0
- package/template-uni-app/src/config/map.ts +15 -0
- package/template-uni-app/src/env.d.ts +36 -0
- package/template-uni-app/src/layouts/default.vue +22 -0
- package/template-uni-app/src/layouts/tabbar.vue +38 -0
- package/template-uni-app/src/main.ts +20 -0
- package/template-uni-app/src/manifest.json +75 -0
- package/template-uni-app/src/pages/demo/index.vue +30 -0
- package/template-uni-app/src/pages/index.vue +65 -0
- package/template-uni-app/src/pages/my.vue +30 -0
- package/template-uni-app/src/pages.json +74 -0
- 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 +16 -0
- package/template-uni-app/src/store/local/index.ts +42 -0
- package/template-uni-app/src/store/system.ts +21 -0
- package/template-uni-app/src/typings/global.d.ts +7 -0
- package/template-uni-app/src/uni.scss +76 -0
- package/template-uni-app/src/utils/auth.ts +204 -0
- package/template-uni-app/src/utils/index.ts +11 -0
- package/template-uni-app/src/utils/map.ts +98 -0
- package/template-uni-app/src/utils/modal.ts +120 -0
- package/template-uni-app/src/utils/route.ts +151 -0
- package/template-uni-app/src/utils/system.ts +67 -0
- package/template-uni-app/tsconfig.json +16 -0
- package/template-uni-app/unocss.config.ts +30 -0
- package/template-uni-app/vite.config.ts +63 -0
- package/template-uni-app/volar.config.js +6 -0
- package/template-vue-mobile/.vscode/base.code-snippets +24 -0
- package/template-vue-mobile/.vscode/extensions.json +10 -0
- package/template-vue-mobile/.vscode/settings.json +7 -0
- package/template-vue-mobile/Dockerfile +42 -0
- package/template-vue-mobile/_env +6 -0
- package/template-vue-mobile/_gitignore +30 -0
- package/template-vue-mobile/boot.mjs +16 -0
- package/template-vue-mobile/build/custom-plugin.ts +30 -0
- package/template-vue-mobile/build/index.ts +7 -0
- package/template-vue-mobile/build/plugins.ts +68 -0
- package/template-vue-mobile/config/.devrc +2 -0
- package/template-vue-mobile/config/.onlinerc +1 -0
- package/template-vue-mobile/config/.testrc +1 -0
- package/template-vue-mobile/index.html +25 -0
- package/template-vue-mobile/nitro.config.ts +19 -0
- package/template-vue-mobile/package.json +48 -0
- package/template-vue-mobile/plugins/env.ts +26 -0
- package/template-vue-mobile/public/vite.svg +1 -0
- package/template-vue-mobile/rome.json +24 -0
- package/template-vue-mobile/routes/[...all].ts +11 -0
- package/template-vue-mobile/routes/get/env.ts +25 -0
- package/template-vue-mobile/src/App.vue +29 -0
- package/template-vue-mobile/src/auto-components.d.ts +24 -0
- package/template-vue-mobile/src/auto-imports.d.ts +289 -0
- package/template-vue-mobile/src/components/Init.vue +36 -0
- package/template-vue-mobile/src/global.d.ts +7 -0
- package/template-vue-mobile/src/hooks/useVerifyCode.ts +46 -0
- package/template-vue-mobile/src/layouts/blank.vue +9 -0
- package/template-vue-mobile/src/layouts/default.vue +27 -0
- package/template-vue-mobile/src/layouts/sub.vue +20 -0
- package/template-vue-mobile/src/main.ts +35 -0
- package/template-vue-mobile/src/modules/1-router.ts +40 -0
- package/template-vue-mobile/src/modules/2-pinia.ts +10 -0
- package/template-vue-mobile/src/modules/3-net.ts +46 -0
- package/template-vue-mobile/src/modules/4-auth.ts +64 -0
- package/template-vue-mobile/src/views/[...all_404].vue +557 -0
- package/template-vue-mobile/src/views/base/login.vue +110 -0
- package/template-vue-mobile/src/views/base/resetPasswd.vue +88 -0
- package/template-vue-mobile/src/views/index.vue +18 -0
- package/template-vue-mobile/src/views/my.vue +15 -0
- package/template-vue-mobile/src/views/sub.vue +18 -0
- package/template-vue-mobile/src/vite-env.d.ts +43 -0
- package/template-vue-mobile/tsconfig.json +21 -0
- package/template-vue-mobile/tsconfig.node.json +9 -0
- package/template-vue-mobile/unocss.config.ts +47 -0
- package/template-vue-mobile/vite.config.ts +32 -0
- package/template-vue-mobile/yarn.lock +4395 -0
- package/template-vue-thin/.vscode/extensions.json +10 -0
- package/template-vue-thin/.vscode/settings.json +4 -0
- package/template-vue-thin/_env +1 -0
- package/template-vue-thin/_gitignore +29 -0
- package/template-vue-thin/index.html +21 -0
- package/template-vue-thin/package.json +40 -0
- package/template-vue-thin/public/vite.svg +1 -0
- package/template-vue-thin/src/App.vue +9 -0
- package/template-vue-thin/src/layouts/blank.vue +9 -0
- package/template-vue-thin/src/layouts/default.vue +12 -0
- package/template-vue-thin/src/layouts/list.vue +12 -0
- package/template-vue-thin/src/main.ts +58 -0
- package/template-vue-thin/src/views/[...all_404].vue +488 -0
- package/template-vue-thin/src/views/index.vue +19 -0
- package/template-vue-thin/src/views/list.vue +17 -0
- package/template-vue-thin/src/vite-env.d.ts +22 -0
- package/template-vue-thin/tsconfig.json +21 -0
- package/template-vue-thin/tsconfig.node.json +9 -0
- package/template-vue-thin/unocss.config.ts +47 -0
- package/template-vue-thin/vite.config.ts +64 -0
- package/tsconfig.json +11 -0
- package/dist/index.mjs +0 -51
@@ -0,0 +1,78 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-16 14:15:51
|
4
|
+
* @LastEditTime: 2023-11-08 10:56:34
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
import { deepClone } from '@bluesyoung/utils'
|
9
|
+
|
10
|
+
const route = useRoute()
|
11
|
+
|
12
|
+
const { logo_url, kj_logo_url, nav_arr, seo } = storeToRefs(useNavStore())
|
13
|
+
|
14
|
+
const [
|
15
|
+
{ data: nav_data },
|
16
|
+
{ data: seo_info },
|
17
|
+
] = await Promise.all([
|
18
|
+
useFetch('/api/get_head_nav'),
|
19
|
+
useFetch('/api/get_seo_info', {
|
20
|
+
params: {
|
21
|
+
page: route.path,
|
22
|
+
},
|
23
|
+
}),
|
24
|
+
])
|
25
|
+
|
26
|
+
if (!nav_data.value || !seo_info.value)
|
27
|
+
throw createError('数据获取失败')
|
28
|
+
|
29
|
+
logo_url.value = getFullServerUrl(nav_data.value.logo_url)
|
30
|
+
kj_logo_url.value = getFullServerUrl(nav_data.value.kj_logo_url)
|
31
|
+
nav_arr.value = nav_data.value.nav_arr
|
32
|
+
seo.value = deepClone(seo_info.value!)
|
33
|
+
|
34
|
+
useHead({
|
35
|
+
meta: [
|
36
|
+
{ name: 'keywords', content: seo.value.keywords },
|
37
|
+
],
|
38
|
+
htmlAttrs: {
|
39
|
+
lang: 'zh-CN',
|
40
|
+
},
|
41
|
+
})
|
42
|
+
|
43
|
+
useSeoMeta({
|
44
|
+
title: seo.value.title,
|
45
|
+
ogTitle: seo.value.title,
|
46
|
+
twitterTitle: seo.value.title,
|
47
|
+
description: seo.value.description,
|
48
|
+
ogDescription: seo.value.description,
|
49
|
+
twitterDescription: seo.value.description,
|
50
|
+
ogImage: logo_url.value,
|
51
|
+
twitterImage: logo_url.value,
|
52
|
+
twitterCard: 'summary_large_image',
|
53
|
+
ogUrl: nav_data.value.site_url,
|
54
|
+
ogType: 'website',
|
55
|
+
})
|
56
|
+
|
57
|
+
const isFull = computed(() => route.query.full || route.meta.full)
|
58
|
+
const bgColor = computed(() => (route.meta.bgColor as string) || '#fff')
|
59
|
+
</script>
|
60
|
+
|
61
|
+
<template>
|
62
|
+
<!-- PC 顶部导航栏 & 移动端首页导航栏 -->
|
63
|
+
<YoungHeader lt-md="!hidden" />
|
64
|
+
<main
|
65
|
+
class="m-auto mt-80px min-h-[calc(100vh-80px)] lt-md:mt-0 min-h-100vh" :style="{
|
66
|
+
backgroundColor: bgColor,
|
67
|
+
}"
|
68
|
+
>
|
69
|
+
<div class="m-auto" lt-md="px-10px" :class="[isFull ? 'w-full' : 'container']">
|
70
|
+
<NuxtPage />
|
71
|
+
</div>
|
72
|
+
</main>
|
73
|
+
|
74
|
+
<!-- 底部 -->
|
75
|
+
<LazyYoungFooter lt-md="!hidden" />
|
76
|
+
<!-- 移动端 tabbar -->
|
77
|
+
<LazyYoungTabbar />
|
78
|
+
</template>
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-09-21 15:57:55
|
4
|
+
* @LastEditTime: 2023-11-08 10:56:04
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { resolve } from 'node:path'
|
9
|
+
|
10
|
+
// https://nuxt.com/docs/api/configuration/nuxt-config
|
11
|
+
export default defineNuxtConfig({
|
12
|
+
'app': {
|
13
|
+
head: {
|
14
|
+
htmlAttrs: {
|
15
|
+
lang: 'zh-CN',
|
16
|
+
},
|
17
|
+
viewport: 'width=device-width,initial-scale=1.0,user-scalable=no,shrink-to-fit=no',
|
18
|
+
meta: [
|
19
|
+
{ name: 'theme-color', content: '#ffffff' },
|
20
|
+
{ name: 'screen-orientation', content: 'portrait' },
|
21
|
+
{ name: 'x5-orientation', content: 'portrait' },
|
22
|
+
{ name: 'renderer', content: 'webkit' },
|
23
|
+
{ name: 'mobile-web-app-capable', content: 'yes' },
|
24
|
+
{ name: 'creator', content: 'BluesYoung-web' },
|
25
|
+
{ 'http-equiv': 'X-UA-Compatible', 'content': 'IE=edge,chrome=1' },
|
26
|
+
{ id: 'viewportMeta', name: 'viewport', content: 'maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0' },
|
27
|
+
{ name: 'format-detection', content: 'telephone=no,email=no,date=no,address=no' },
|
28
|
+
],
|
29
|
+
script: [
|
30
|
+
{
|
31
|
+
innerHTML: `
|
32
|
+
this.globalThis || (this.globalThis = this);
|
33
|
+
window.onerror = function(e) {
|
34
|
+
console.log(e)
|
35
|
+
window.alert('您的浏览器版本过低,请尝试使用其他浏览器或将浏览器升级至最新版本后重试!');
|
36
|
+
}
|
37
|
+
|
38
|
+
// ios 支付宝浏览器,兜底
|
39
|
+
const ua = navigator.userAgent;
|
40
|
+
const pathname = window.location.pathname;
|
41
|
+
if (/Alipay/img.test(ua) && /iPhone/img.test(ua) && pathname !== '/callback_pay.html') {
|
42
|
+
alert('当前环境受限,建议使用系统浏览器打开!');
|
43
|
+
window.close();
|
44
|
+
history.back();
|
45
|
+
AlipayJSBridge && AlipayJSBridge.call && AlipayJSBridge.call('popWindow');
|
46
|
+
}
|
47
|
+
`,
|
48
|
+
},
|
49
|
+
],
|
50
|
+
link: [
|
51
|
+
{ rel: 'icon', type: 'image/png', href: '/favicon.ico' },
|
52
|
+
{ rel: 'apple-touch-icon', type: 'image/png', href: '/favicon.ico' },
|
53
|
+
{ rel: 'apple-touch-icon-precomposed', type: 'image/png', href: '/favicon.ico' },
|
54
|
+
// dns 预解析
|
55
|
+
{ rel: 'dns-prefetch', href: 'https://master-web-cdn.laiyouxi.com' },
|
56
|
+
// 图片预加载
|
57
|
+
{ rel: 'prefetch', href: '/svg/image_placeholder.svg', as: 'image' },
|
58
|
+
],
|
59
|
+
},
|
60
|
+
},
|
61
|
+
'devtools': { enabled: false },
|
62
|
+
'modules': [
|
63
|
+
'nuxt-swiper',
|
64
|
+
'@nuxtjs/device',
|
65
|
+
'@pinia/nuxt',
|
66
|
+
'@unocss/nuxt',
|
67
|
+
'@vueuse/nuxt',
|
68
|
+
'@element-plus/nuxt',
|
69
|
+
'@vant/nuxt',
|
70
|
+
'@formkit/auto-animate/nuxt',
|
71
|
+
'@bluesyoung/nuxt3-lazy-load',
|
72
|
+
],
|
73
|
+
'unocss': {
|
74
|
+
// 默认的 @unocss/reset/tailwind.css 会造成 element 样式异常
|
75
|
+
// 手动注入 @unocss/reset/tailwind-compat.css
|
76
|
+
preflight: false,
|
77
|
+
},
|
78
|
+
|
79
|
+
'nitro': {
|
80
|
+
output: {
|
81
|
+
dir: resolve(__dirname, './dist'),
|
82
|
+
},
|
83
|
+
sourceMap: false,
|
84
|
+
minify: true,
|
85
|
+
},
|
86
|
+
|
87
|
+
'@bluesyoung/nuxt3-lazy-load': {
|
88
|
+
defaultImage: '/svg/image_placeholder.svg',
|
89
|
+
},
|
90
|
+
|
91
|
+
'vite': {
|
92
|
+
build: {
|
93
|
+
// 兼容钉钉浏览器
|
94
|
+
target: 'es2015',
|
95
|
+
sourcemap: false,
|
96
|
+
},
|
97
|
+
},
|
98
|
+
})
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"name": "nuxt3-website",
|
3
|
+
"type": "module",
|
4
|
+
"version": "0.0.0",
|
5
|
+
"private": true,
|
6
|
+
"scripts": {
|
7
|
+
"build": "nuxt build",
|
8
|
+
"dev": "nuxt dev --host",
|
9
|
+
"generate": "nuxt generate",
|
10
|
+
"preview": "nuxt preview --host",
|
11
|
+
"postinstall": "nuxt prepare",
|
12
|
+
"lint": "eslint .",
|
13
|
+
"lint:fix": "eslint . --fix"
|
14
|
+
},
|
15
|
+
"dependencies": {
|
16
|
+
"@bluesyoung/logger": "^0.0.1",
|
17
|
+
"@bluesyoung/utils": "^0.2.1",
|
18
|
+
"c12": "^1.4.2",
|
19
|
+
"http-proxy": "^1.18.1"
|
20
|
+
},
|
21
|
+
"devDependencies": {
|
22
|
+
"@antfu/eslint-config": "^1.1.0",
|
23
|
+
"@bluesyoung/nuxt3-lazy-load": "^1.3.0",
|
24
|
+
"@element-plus/nuxt": "^1.0.6",
|
25
|
+
"@formkit/auto-animate": "^0.8.0",
|
26
|
+
"@iconify/json": "^2.2.135",
|
27
|
+
"@nuxtjs/device": "^3.1.1",
|
28
|
+
"@pinia/nuxt": "^0.5.1",
|
29
|
+
"@unocss/nuxt": "^0.57.1",
|
30
|
+
"@vant/nuxt": "^1.0.3",
|
31
|
+
"@vueuse/nuxt": "^10.5.0",
|
32
|
+
"element-plus": "^2.3.14",
|
33
|
+
"eslint": "^8.51.0",
|
34
|
+
"nuxt": "3.7.4",
|
35
|
+
"nuxt-swiper": "^1.2.2",
|
36
|
+
"sass": "^1.69.5",
|
37
|
+
"typescript": "^5.2.2",
|
38
|
+
"vant": "^4.7.3",
|
39
|
+
"vconsole": "^3.15.1"
|
40
|
+
}
|
41
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-08 15:12:27
|
4
|
+
* @LastEditTime: 2023-10-08 15:13:35
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
navigateTo('/', {
|
9
|
+
replace: true,
|
10
|
+
redirectCode: 301,
|
11
|
+
})
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<template>
|
15
|
+
<div />
|
16
|
+
</template>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-09-21 16:38:58
|
4
|
+
* @LastEditTime: 2023-11-08 09:54:17
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
definePageMeta({
|
9
|
+
layout: 'home',
|
10
|
+
full: true,
|
11
|
+
})
|
12
|
+
|
13
|
+
const [
|
14
|
+
{ data: bdata },
|
15
|
+
] = await Promise.all([
|
16
|
+
useFetch('/api/get_home_banner'),
|
17
|
+
])
|
18
|
+
|
19
|
+
const banners = ref<BannerItem[]>([])
|
20
|
+
|
21
|
+
if (!bdata.value)
|
22
|
+
throw createError('数据获取失败')
|
23
|
+
|
24
|
+
banners.value = bdata.value
|
25
|
+
</script>
|
26
|
+
|
27
|
+
<template>
|
28
|
+
<YoungBanner v-if="banners.length > 0" :banners="banners" preload />
|
29
|
+
</template>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-08 17:30:30
|
4
|
+
* @LastEditTime: 2023-11-08 11:05:53
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
const bread_nav: BreadNavItem[] = [
|
9
|
+
{ title: '首页', href: '/' },
|
10
|
+
{ title: '赛事', href: '/match.html' },
|
11
|
+
]
|
12
|
+
|
13
|
+
definePageMeta({
|
14
|
+
layout: 'tabbar',
|
15
|
+
})
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<template>
|
19
|
+
<div class="pt-20px flex justify-between text-16px lh-24px font-400 color-[#333]" lt-md="hidden">
|
20
|
+
<BreadNav :nav-arr="bread_nav" />
|
21
|
+
</div>
|
22
|
+
match
|
23
|
+
</template>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2022-08-15 10:04:05
|
4
|
+
* @LastEditTime: 2023-11-08 10:51:31
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
const { active_nav } = storeToRefs(useNavStore())
|
9
|
+
|
10
|
+
definePageMeta({
|
11
|
+
name: '文章详情',
|
12
|
+
})
|
13
|
+
|
14
|
+
if (process.client)
|
15
|
+
active_nav.value = '/news.html'
|
16
|
+
|
17
|
+
const route = useRoute()
|
18
|
+
const { id } = route.params
|
19
|
+
|
20
|
+
const bread_nav: BreadNavItem[] = [
|
21
|
+
{ title: '首页', href: '/' },
|
22
|
+
{ title: '资讯', href: '/news.html' },
|
23
|
+
{ title: '新闻', href: `/news/${id}.html` },
|
24
|
+
]
|
25
|
+
|
26
|
+
useHead({
|
27
|
+
meta: [
|
28
|
+
{
|
29
|
+
name: 'keywords',
|
30
|
+
content: '我是关键字',
|
31
|
+
},
|
32
|
+
],
|
33
|
+
})
|
34
|
+
|
35
|
+
useSeoMeta({
|
36
|
+
title: '我是标题',
|
37
|
+
ogTitle: '我是标题',
|
38
|
+
twitterTitle: '我是标题',
|
39
|
+
description: '我是描述',
|
40
|
+
ogDescription: '我是描述',
|
41
|
+
twitterDescription: '我是描述',
|
42
|
+
twitterCard: 'summary_large_image',
|
43
|
+
ogType: 'article',
|
44
|
+
})
|
45
|
+
</script>
|
46
|
+
|
47
|
+
<template>
|
48
|
+
<div>
|
49
|
+
<div class="pt-20px flex justify-between text-16px lh-24px font-400 color-[#333]" lt-md="pt-0">
|
50
|
+
<BreadNav :nav-arr="bread_nav" />
|
51
|
+
</div>
|
52
|
+
<div class="w-[62.5%] mx-auto mb-80px reset-img" lt-md="w-full">
|
53
|
+
params:
|
54
|
+
- id: {{ id }}
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
</template>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-08 17:27:57
|
4
|
+
* @LastEditTime: 2023-11-08 11:04:45
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
const bread_nav: BreadNavItem[] = [
|
9
|
+
{ title: '首页', href: '/' },
|
10
|
+
{ title: '资讯', href: '/news.html' },
|
11
|
+
]
|
12
|
+
|
13
|
+
definePageMeta({
|
14
|
+
layout: 'tabbar',
|
15
|
+
})
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<template>
|
19
|
+
<div class="flex justify-between text-16px lh-24px font-400 color-[#333] py-20px" lt-md="py-0">
|
20
|
+
<BreadNav :nav-arr="bread_nav" />
|
21
|
+
</div>
|
22
|
+
<div>news list</div>
|
23
|
+
<NuxtLink to="/news/2233.html" class="text-blue-500">
|
24
|
+
go news detail
|
25
|
+
</NuxtLink>
|
26
|
+
</template>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-08 17:18:31
|
4
|
+
* @LastEditTime: 2023-11-08 09:34:15
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
definePageMeta({
|
9
|
+
layout: 'tabbar',
|
10
|
+
})
|
11
|
+
|
12
|
+
const bread_nav = ref<BreadNavItem[]>([
|
13
|
+
{ title: '首页', href: '/' },
|
14
|
+
{ title: '商城', href: '/shop.html' },
|
15
|
+
])
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<template>
|
19
|
+
<div lt-md="pb-80px">
|
20
|
+
<div class="py-20px flex justify-between text-16px lh-24px font-400 color-[#333]" lt-md="hidden">
|
21
|
+
<BreadNav :nav-arr="bread_nav" />
|
22
|
+
</div>
|
23
|
+
|
24
|
+
shop
|
25
|
+
</div>
|
26
|
+
</template>
|
Binary file
|
@@ -0,0 +1,15 @@
|
|
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>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-07 16:02:03
|
4
|
+
* @LastEditTime: 2023-11-08 10:32:38
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { NUXT_PUBLIC_CACHE_TIME } from '~~/composables/config'
|
8
|
+
|
9
|
+
export default cachedEventHandler(async () => {
|
10
|
+
console.log('start get footer info')
|
11
|
+
|
12
|
+
try {
|
13
|
+
const friend_links: FriendLinkItem[] = [
|
14
|
+
{
|
15
|
+
title: '来游戏',
|
16
|
+
href: 'https://www.laiyouxi.com'
|
17
|
+
},
|
18
|
+
{
|
19
|
+
title: '🌾',
|
20
|
+
href: 'https://mi.com'
|
21
|
+
}
|
22
|
+
]
|
23
|
+
const follow_us: FollowItem[] = []
|
24
|
+
const about_nav: AboutNavItem[] = []
|
25
|
+
const beian = `<p><a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">ICP:鄂B2-20120057-2</a>文网文:鄂网文[2020]5051-198号 文网游备字:[2015]M-CBG0688号 新广出审:[2015]1273号</p>
|
26
|
+
|
27
|
+
<p>全国文明市场统一举报电话:12318武汉卓讯互动信息科技有限公司 版权所有</p>
|
28
|
+
|
29
|
+
<p>湖北省文化市场诚信守法经营承诺书</p>
|
30
|
+
|
31
|
+
<p>未满18周岁的未成年人用户请在家长的监督下进行游戏 | 未成年人家长监护工程</p>
|
32
|
+
|
33
|
+
<p><a href="https://www.beian.gov.cn/portal/registerSystemInfo?recordcode=42018502000478" target="_blank">鄂公网安备 42018502000478号</a> <img alt="" loading="lazy" src="https://app-storage.laiyouxi.com/mchadminserver/2e524461-3725-40d9-b1e9-c7a15ba6bef5.png"> <img alt="" loading="lazy" src="https://app-storage.laiyouxi.com/mchadminserver/cf4e3416-14c8-46f2-8e02-55ccb991e123.png"> <img alt="" loading="lazy" src="https://app-storage.laiyouxi.com/mchadminserver/ba41a711-52b6-4d12-8800-5f49443aa84b.png"> <img alt="" loading="lazy" src="https://app-storage.laiyouxi.com/mchadminserver/25af8dc3-9665-4519-8885-d840d7c15599.png"> <img alt="" src="https://app-storage.laiyouxi.com/mchadminserver/3acd60f6-d583-48c1-b16a-87288960df3f.png" loading="lazy"></p>
|
34
|
+
|
35
|
+
<p>健康游戏忠告:抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当 适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活</p>`
|
36
|
+
|
37
|
+
return {
|
38
|
+
logo_bottom: 'https://master-web-cdn.laiyouxi.com/platform_index/online/74af573514bce434ef1aad683250e8f0.png',
|
39
|
+
friend_links,
|
40
|
+
follow_us,
|
41
|
+
about_nav,
|
42
|
+
beian,
|
43
|
+
}
|
44
|
+
}
|
45
|
+
catch (error) {
|
46
|
+
console.error('get footer info fail: ', error)
|
47
|
+
return false
|
48
|
+
}
|
49
|
+
}, {
|
50
|
+
maxAge: NUXT_PUBLIC_CACHE_TIME,
|
51
|
+
swr: true,
|
52
|
+
})
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-06-07 12:06:48
|
4
|
+
* @LastEditTime: 2023-11-08 10:30:59
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { NUXT_PUBLIC_CACHE_TIME } from '~~/composables/config'
|
8
|
+
/**
|
9
|
+
* @example 服务端请求示例
|
10
|
+
*/
|
11
|
+
export default cachedEventHandler(async (event) => {
|
12
|
+
// const ServerFetch = useServerFetch(event)
|
13
|
+
|
14
|
+
try {
|
15
|
+
// const { gray = false } = (await ServerFetch<{ gray: boolean }>('/api/v1/is_gray')) || {}
|
16
|
+
return {
|
17
|
+
/**
|
18
|
+
* 是否置灰
|
19
|
+
*/
|
20
|
+
is_gray: false,
|
21
|
+
/**
|
22
|
+
* 全局置灰为 *
|
23
|
+
* 否则仅首页置灰
|
24
|
+
*/
|
25
|
+
scope: '',
|
26
|
+
}
|
27
|
+
}
|
28
|
+
catch (error) {
|
29
|
+
console.error('get gray status fail: ', error)
|
30
|
+
return {
|
31
|
+
is_gray: false,
|
32
|
+
scope: '',
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}, {
|
36
|
+
maxAge: NUXT_PUBLIC_CACHE_TIME * 3,
|
37
|
+
swr: true,
|
38
|
+
})
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-06-07 14:43:38
|
4
|
+
* @LastEditTime: 2023-11-08 09:53:14
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { NUXT_PUBLIC_CACHE_TIME } from '~~/composables/config'
|
8
|
+
|
9
|
+
export default cachedEventHandler(async () => {
|
10
|
+
console.log('start get head info')
|
11
|
+
|
12
|
+
try {
|
13
|
+
const nav_arr: NavItem[] = [
|
14
|
+
{ title: '首页', href: '/' },
|
15
|
+
{ title: '资讯', href: '/news.html' },
|
16
|
+
{ title: '赛事', href: '/match.html' },
|
17
|
+
{ title: '商城', href: '/shop.html' }
|
18
|
+
]
|
19
|
+
const fromMobile = process.env.PROJECT_NAME === 'mobile'
|
20
|
+
|
21
|
+
return {
|
22
|
+
logo_url: 'https://master-web-cdn.laiyouxi.com/platform_index/online/744f27a210a9098c79f58d115cc321ea.png',
|
23
|
+
kj_logo_url: 'https://master-web-cdn.laiyouxi.com/platform_index/online/83fa32ed0e3f286fccd93dae7d9bee8c.png',
|
24
|
+
nav_arr,
|
25
|
+
showAd: false,
|
26
|
+
img_ad: '',
|
27
|
+
img_btn: '',
|
28
|
+
site_url: fromMobile ? process.env.VITE_WEBSITE_MOBILE! : process.env.VITE_WEBSITE_PC!,
|
29
|
+
}
|
30
|
+
}
|
31
|
+
catch (error) {
|
32
|
+
console.error('get head info fail: ', error)
|
33
|
+
return false
|
34
|
+
}
|
35
|
+
}, {
|
36
|
+
maxAge: NUXT_PUBLIC_CACHE_TIME,
|
37
|
+
swr: true,
|
38
|
+
})
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-07 17:43:38
|
4
|
+
* @LastEditTime: 2023-10-09 12:08:35
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { NUXT_PUBLIC_CACHE_TIME } from '~~/composables/config'
|
8
|
+
|
9
|
+
export default cachedEventHandler(async (event) => {
|
10
|
+
console.log('start get home banner')
|
11
|
+
|
12
|
+
try {
|
13
|
+
const banners: BannerItem[] = [
|
14
|
+
{
|
15
|
+
img_url: 'https://master-web-cdn.laiyouxi.com/platform_index/online/files/banner-pc.png'
|
16
|
+
}
|
17
|
+
]
|
18
|
+
|
19
|
+
return banners
|
20
|
+
}
|
21
|
+
catch (error) {
|
22
|
+
console.error('get home banner fail: ', error)
|
23
|
+
return false
|
24
|
+
}
|
25
|
+
}, {
|
26
|
+
maxAge: NUXT_PUBLIC_CACHE_TIME,
|
27
|
+
swr: true,
|
28
|
+
})
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-06-07 14:29:59
|
4
|
+
* @LastEditTime: 2023-11-08 09:51:06
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { NUXT_PUBLIC_CACHE_TIME } from '~~/composables/config'
|
8
|
+
|
9
|
+
export default cachedEventHandler(async (event) => {
|
10
|
+
console.log('start get seo info')
|
11
|
+
|
12
|
+
const { page } = getQuery(event)
|
13
|
+
/**
|
14
|
+
* 对于特定页面的 seo 进行相应的索引
|
15
|
+
*/
|
16
|
+
console.log('🚀 ~ file: get_seo_info.get.ts:10 ~ cachedEventHandler ~ page:', page)
|
17
|
+
|
18
|
+
try {
|
19
|
+
return {
|
20
|
+
keywords: '我是关键字,啦啦啦,哈哈哈',
|
21
|
+
description: '我是描述,啦啦啦,哈哈哈',
|
22
|
+
title: '我是标题,啦啦啦,哈哈哈',
|
23
|
+
} as SeoInfo
|
24
|
+
}
|
25
|
+
catch (error) {
|
26
|
+
console.error('get seo info fail: ', error)
|
27
|
+
return false
|
28
|
+
}
|
29
|
+
}, {
|
30
|
+
maxAge: NUXT_PUBLIC_CACHE_TIME * 30,
|
31
|
+
swr: true,
|
32
|
+
})
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-07 12:11:46
|
4
|
+
* @LastEditTime: 2023-11-01 19:09:47
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
export default defineEventHandler((event) => {
|
8
|
+
event.context.platformSource = process.env.PROJECT_NAME === 'mobile' ? 'mobile' : 'pc'
|
9
|
+
event.context['x-forwarded-for'] = event.node.req.headers['x-forwarded-for'] as string
|
10
|
+
event.context['x-real-ip'] = event.node.req.headers['x-real-ip'] as string
|
11
|
+
})
|