diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..65f8977 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +dist +.git +.nuxt +.output +node_modules \ No newline at end of file diff --git a/.gitignore b/.gitignore index a5a6c7b..438cb08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,34 +1,8 @@ -.DS_Store -.git -Thumbs.db -*.log -.idea - -.dist -node_modules/ -u.sh -.github*/ - - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build +node_modules +*.log* +.nuxt +.nitro +.cache +.output +.env dist - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/.nuxt/components.d.ts b/.nuxt/components.d.ts deleted file mode 100644 index 2141ca8..0000000 --- a/.nuxt/components.d.ts +++ /dev/null @@ -1,242 +0,0 @@ -// Generated by components discovery -declare module 'vue' { - export interface GlobalComponents { - 'Banner': typeof import("../components/Banner.vue")['default'], - 'BbsTabs': typeof import("../components/BbsTabs.vue")['default'], - 'BookList': typeof import("../components/BookList.vue")['default'], - 'Comment': typeof import("../components/Comment.vue")['default'], - 'CouponList': typeof import("../components/CouponList.vue")['default'], - 'CouponModal': typeof import("../components/CouponModal.vue")['default'], - 'CourseList': typeof import("../components/CourseList.vue")['default'], - 'Empty': typeof import("../components/Empty.vue")['default'], - 'FavaBtn': typeof import("../components/FavaBtn.vue")['default'], - 'GotoTop': typeof import("../components/GotoTop.vue")['default'], - 'HotCourseList': typeof import("../components/HotCourseList.vue")['default'], - 'ImageAd': typeof import("../components/ImageAd.vue")['default'], - 'ImageNav': typeof import("../components/ImageNav.vue")['default'], - 'ListCard': typeof import("../components/ListCard.vue")['default'], - 'LiveStatusBar': typeof import("../components/LiveStatusBar.vue")['default'], - 'NavBar': typeof import("../components/NavBar.vue")['default'], - 'PageFooter': typeof import("../components/PageFooter.vue")['default'], - 'PaperTestItems': typeof import("../components/PaperTestItems.vue")['default'], - 'PostList': typeof import("../components/PostList.vue")['default'], - 'Price': typeof import("../components/Price.vue")['default'], - 'QrCode': typeof import("../components/QrCode.vue")['default'], - 'SearchBar': typeof import("../components/SearchBar.vue")['default'], - 'Seckill': typeof import("../components/Seckill.vue")['default'], - 'SendCode': typeof import("../components/SendCode.vue")['default'], - 'TestPaperList': typeof import("../components/TestPaperList.vue")['default'], - 'TimeBox': typeof import("../components/TimeBox.vue")['default'], - 'Uploader': typeof import("../components/Uploader.vue")['default'], - 'DetailActiveBar': typeof import("../components/Detail/ActiveBar.vue")['default'], - 'DetailGroupWorks': typeof import("../components/Detail/GroupWorks.vue")['default'], - 'DetailMenu': typeof import("../components/Detail/Menu.vue")['default'], - 'DetailMenuItem': typeof import("../components/Detail/MenuItem.vue")['default'], - 'LoadingBookSkeletion': typeof import("../components/Loading/BookSkeletion.vue")['default'], - 'LoadingCourseSkeleton': typeof import("../components/Loading/CourseSkeleton.vue")['default'], - 'LoadingGroup': typeof import("../components/Loading/Group.vue")['default'], - 'LoadingSkeleton': typeof import("../components/Loading/Skeleton.vue")['default'], - 'PlayerAudio': typeof import("../components/Player/Audio.vue")['default'], - 'PlayerLive': typeof import("../components/Player/Live.vue")['default'], - 'PlayerVideo': typeof import("../components/Player/Video.vue")['default'], - 'UiImage': typeof import("../components/Ui/Image.vue")['default'], - 'UiMenu': typeof import("../components/Ui/Menu.vue")['default'], - 'UiMenuItem': typeof import("../components/Ui/MenuItem.vue")['default'], - 'UiTab': typeof import("../components/Ui/Tab.vue")['default'], - 'UiTabItem': typeof import("../components/Ui/TabItem.vue")['default'], - 'UserBuyList': typeof import("../components/User/BuyList.vue")['default'], - 'UserCouponList': typeof import("../components/User/CouponList.vue")['default'], - 'UserFavaList': typeof import("../components/User/FavaList.vue")['default'], - 'UserHistoryList': typeof import("../components/User/HistoryList.vue")['default'], - 'UserTestList': typeof import("../components/User/TestList.vue")['default'], - 'UiCardBody': typeof import("../components/Ui/Card/Body.vue")['default'], - 'UiCardFooter': typeof import("../components/Ui/Card/Footer.vue")['default'], - 'UiCardHeader': typeof import("../components/Ui/Card/Header.vue")['default'], - 'UiCard': typeof import("../components/Ui/Card/index.vue")['default'], - 'NuxtWelcome': typeof import("../node_modules/@nuxt/ui-templates/dist/templates/welcome.vue")['default'], - 'NuxtLayout': typeof import("../node_modules/nuxt/dist/app/components/layout")['default'], - 'NuxtErrorBoundary': typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default'], - 'ClientOnly': typeof import("../node_modules/nuxt/dist/app/components/client-only")['default'], - 'ServerPlaceholder': typeof import("../node_modules/nuxt/dist/app/components/server-placeholder")['default'], - 'NuxtLink': typeof import("../node_modules/nuxt/dist/app/components/nuxt-link")['default'], - 'NuxtLoadingIndicator': typeof import("../node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default'] - 'LazyBanner': typeof import("../components/Banner.vue")['default'], - 'LazyBbsTabs': typeof import("../components/BbsTabs.vue")['default'], - 'LazyBookList': typeof import("../components/BookList.vue")['default'], - 'LazyComment': typeof import("../components/Comment.vue")['default'], - 'LazyCouponList': typeof import("../components/CouponList.vue")['default'], - 'LazyCouponModal': typeof import("../components/CouponModal.vue")['default'], - 'LazyCourseList': typeof import("../components/CourseList.vue")['default'], - 'LazyEmpty': typeof import("../components/Empty.vue")['default'], - 'LazyFavaBtn': typeof import("../components/FavaBtn.vue")['default'], - 'LazyGotoTop': typeof import("../components/GotoTop.vue")['default'], - 'LazyHotCourseList': typeof import("../components/HotCourseList.vue")['default'], - 'LazyImageAd': typeof import("../components/ImageAd.vue")['default'], - 'LazyImageNav': typeof import("../components/ImageNav.vue")['default'], - 'LazyListCard': typeof import("../components/ListCard.vue")['default'], - 'LazyLiveStatusBar': typeof import("../components/LiveStatusBar.vue")['default'], - 'LazyNavBar': typeof import("../components/NavBar.vue")['default'], - 'LazyPageFooter': typeof import("../components/PageFooter.vue")['default'], - 'LazyPaperTestItems': typeof import("../components/PaperTestItems.vue")['default'], - 'LazyPostList': typeof import("../components/PostList.vue")['default'], - 'LazyPrice': typeof import("../components/Price.vue")['default'], - 'LazyQrCode': typeof import("../components/QrCode.vue")['default'], - 'LazySearchBar': typeof import("../components/SearchBar.vue")['default'], - 'LazySeckill': typeof import("../components/Seckill.vue")['default'], - 'LazySendCode': typeof import("../components/SendCode.vue")['default'], - 'LazyTestPaperList': typeof import("../components/TestPaperList.vue")['default'], - 'LazyTimeBox': typeof import("../components/TimeBox.vue")['default'], - 'LazyUploader': typeof import("../components/Uploader.vue")['default'], - 'LazyDetailActiveBar': typeof import("../components/Detail/ActiveBar.vue")['default'], - 'LazyDetailGroupWorks': typeof import("../components/Detail/GroupWorks.vue")['default'], - 'LazyDetailMenu': typeof import("../components/Detail/Menu.vue")['default'], - 'LazyDetailMenuItem': typeof import("../components/Detail/MenuItem.vue")['default'], - 'LazyLoadingBookSkeletion': typeof import("../components/Loading/BookSkeletion.vue")['default'], - 'LazyLoadingCourseSkeleton': typeof import("../components/Loading/CourseSkeleton.vue")['default'], - 'LazyLoadingGroup': typeof import("../components/Loading/Group.vue")['default'], - 'LazyLoadingSkeleton': typeof import("../components/Loading/Skeleton.vue")['default'], - 'LazyPlayerAudio': typeof import("../components/Player/Audio.vue")['default'], - 'LazyPlayerLive': typeof import("../components/Player/Live.vue")['default'], - 'LazyPlayerVideo': typeof import("../components/Player/Video.vue")['default'], - 'LazyUiImage': typeof import("../components/Ui/Image.vue")['default'], - 'LazyUiMenu': typeof import("../components/Ui/Menu.vue")['default'], - 'LazyUiMenuItem': typeof import("../components/Ui/MenuItem.vue")['default'], - 'LazyUiTab': typeof import("../components/Ui/Tab.vue")['default'], - 'LazyUiTabItem': typeof import("../components/Ui/TabItem.vue")['default'], - 'LazyUserBuyList': typeof import("../components/User/BuyList.vue")['default'], - 'LazyUserCouponList': typeof import("../components/User/CouponList.vue")['default'], - 'LazyUserFavaList': typeof import("../components/User/FavaList.vue")['default'], - 'LazyUserHistoryList': typeof import("../components/User/HistoryList.vue")['default'], - 'LazyUserTestList': typeof import("../components/User/TestList.vue")['default'], - 'LazyUiCardBody': typeof import("../components/Ui/Card/Body.vue")['default'], - 'LazyUiCardFooter': typeof import("../components/Ui/Card/Footer.vue")['default'], - 'LazyUiCardHeader': typeof import("../components/Ui/Card/Header.vue")['default'], - 'LazyUiCard': typeof import("../components/Ui/Card/index.vue")['default'], - 'LazyNuxtWelcome': typeof import("../node_modules/@nuxt/ui-templates/dist/templates/welcome.vue")['default'], - 'LazyNuxtLayout': typeof import("../node_modules/nuxt/dist/app/components/layout")['default'], - 'LazyNuxtErrorBoundary': typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default'], - 'LazyClientOnly': typeof import("../node_modules/nuxt/dist/app/components/client-only")['default'], - 'LazyServerPlaceholder': typeof import("../node_modules/nuxt/dist/app/components/server-placeholder")['default'], - 'LazyNuxtLink': typeof import("../node_modules/nuxt/dist/app/components/nuxt-link")['default'], - 'LazyNuxtLoadingIndicator': typeof import("../node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default'] - } -} -export const Banner: typeof import("../components/Banner.vue")['default'] -export const BbsTabs: typeof import("../components/BbsTabs.vue")['default'] -export const BookList: typeof import("../components/BookList.vue")['default'] -export const Comment: typeof import("../components/Comment.vue")['default'] -export const CouponList: typeof import("../components/CouponList.vue")['default'] -export const CouponModal: typeof import("../components/CouponModal.vue")['default'] -export const CourseList: typeof import("../components/CourseList.vue")['default'] -export const Empty: typeof import("../components/Empty.vue")['default'] -export const FavaBtn: typeof import("../components/FavaBtn.vue")['default'] -export const GotoTop: typeof import("../components/GotoTop.vue")['default'] -export const HotCourseList: typeof import("../components/HotCourseList.vue")['default'] -export const ImageAd: typeof import("../components/ImageAd.vue")['default'] -export const ImageNav: typeof import("../components/ImageNav.vue")['default'] -export const ListCard: typeof import("../components/ListCard.vue")['default'] -export const LiveStatusBar: typeof import("../components/LiveStatusBar.vue")['default'] -export const NavBar: typeof import("../components/NavBar.vue")['default'] -export const PageFooter: typeof import("../components/PageFooter.vue")['default'] -export const PaperTestItems: typeof import("../components/PaperTestItems.vue")['default'] -export const PostList: typeof import("../components/PostList.vue")['default'] -export const Price: typeof import("../components/Price.vue")['default'] -export const QrCode: typeof import("../components/QrCode.vue")['default'] -export const SearchBar: typeof import("../components/SearchBar.vue")['default'] -export const Seckill: typeof import("../components/Seckill.vue")['default'] -export const SendCode: typeof import("../components/SendCode.vue")['default'] -export const TestPaperList: typeof import("../components/TestPaperList.vue")['default'] -export const TimeBox: typeof import("../components/TimeBox.vue")['default'] -export const Uploader: typeof import("../components/Uploader.vue")['default'] -export const DetailActiveBar: typeof import("../components/Detail/ActiveBar.vue")['default'] -export const DetailGroupWorks: typeof import("../components/Detail/GroupWorks.vue")['default'] -export const DetailMenu: typeof import("../components/Detail/Menu.vue")['default'] -export const DetailMenuItem: typeof import("../components/Detail/MenuItem.vue")['default'] -export const LoadingBookSkeletion: typeof import("../components/Loading/BookSkeletion.vue")['default'] -export const LoadingCourseSkeleton: typeof import("../components/Loading/CourseSkeleton.vue")['default'] -export const LoadingGroup: typeof import("../components/Loading/Group.vue")['default'] -export const LoadingSkeleton: typeof import("../components/Loading/Skeleton.vue")['default'] -export const PlayerAudio: typeof import("../components/Player/Audio.vue")['default'] -export const PlayerLive: typeof import("../components/Player/Live.vue")['default'] -export const PlayerVideo: typeof import("../components/Player/Video.vue")['default'] -export const UiImage: typeof import("../components/Ui/Image.vue")['default'] -export const UiMenu: typeof import("../components/Ui/Menu.vue")['default'] -export const UiMenuItem: typeof import("../components/Ui/MenuItem.vue")['default'] -export const UiTab: typeof import("../components/Ui/Tab.vue")['default'] -export const UiTabItem: typeof import("../components/Ui/TabItem.vue")['default'] -export const UserBuyList: typeof import("../components/User/BuyList.vue")['default'] -export const UserCouponList: typeof import("../components/User/CouponList.vue")['default'] -export const UserFavaList: typeof import("../components/User/FavaList.vue")['default'] -export const UserHistoryList: typeof import("../components/User/HistoryList.vue")['default'] -export const UserTestList: typeof import("../components/User/TestList.vue")['default'] -export const UiCardBody: typeof import("../components/Ui/Card/Body.vue")['default'] -export const UiCardFooter: typeof import("../components/Ui/Card/Footer.vue")['default'] -export const UiCardHeader: typeof import("../components/Ui/Card/Header.vue")['default'] -export const UiCard: typeof import("../components/Ui/Card/index.vue")['default'] -export const NuxtWelcome: typeof import("../node_modules/@nuxt/ui-templates/dist/templates/welcome.vue")['default'] -export const NuxtLayout: typeof import("../node_modules/nuxt/dist/app/components/layout")['default'] -export const NuxtErrorBoundary: typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default'] -export const ClientOnly: typeof import("../node_modules/nuxt/dist/app/components/client-only")['default'] -export const ServerPlaceholder: typeof import("../node_modules/nuxt/dist/app/components/server-placeholder")['default'] -export const NuxtLink: typeof import("../node_modules/nuxt/dist/app/components/nuxt-link")['default'] -export const NuxtLoadingIndicator: typeof import("../node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default'] -export const LazyBanner: typeof import("../components/Banner.vue")['default'] -export const LazyBbsTabs: typeof import("../components/BbsTabs.vue")['default'] -export const LazyBookList: typeof import("../components/BookList.vue")['default'] -export const LazyComment: typeof import("../components/Comment.vue")['default'] -export const LazyCouponList: typeof import("../components/CouponList.vue")['default'] -export const LazyCouponModal: typeof import("../components/CouponModal.vue")['default'] -export const LazyCourseList: typeof import("../components/CourseList.vue")['default'] -export const LazyEmpty: typeof import("../components/Empty.vue")['default'] -export const LazyFavaBtn: typeof import("../components/FavaBtn.vue")['default'] -export const LazyGotoTop: typeof import("../components/GotoTop.vue")['default'] -export const LazyHotCourseList: typeof import("../components/HotCourseList.vue")['default'] -export const LazyImageAd: typeof import("../components/ImageAd.vue")['default'] -export const LazyImageNav: typeof import("../components/ImageNav.vue")['default'] -export const LazyListCard: typeof import("../components/ListCard.vue")['default'] -export const LazyLiveStatusBar: typeof import("../components/LiveStatusBar.vue")['default'] -export const LazyNavBar: typeof import("../components/NavBar.vue")['default'] -export const LazyPageFooter: typeof import("../components/PageFooter.vue")['default'] -export const LazyPaperTestItems: typeof import("../components/PaperTestItems.vue")['default'] -export const LazyPostList: typeof import("../components/PostList.vue")['default'] -export const LazyPrice: typeof import("../components/Price.vue")['default'] -export const LazyQrCode: typeof import("../components/QrCode.vue")['default'] -export const LazySearchBar: typeof import("../components/SearchBar.vue")['default'] -export const LazySeckill: typeof import("../components/Seckill.vue")['default'] -export const LazySendCode: typeof import("../components/SendCode.vue")['default'] -export const LazyTestPaperList: typeof import("../components/TestPaperList.vue")['default'] -export const LazyTimeBox: typeof import("../components/TimeBox.vue")['default'] -export const LazyUploader: typeof import("../components/Uploader.vue")['default'] -export const LazyDetailActiveBar: typeof import("../components/Detail/ActiveBar.vue")['default'] -export const LazyDetailGroupWorks: typeof import("../components/Detail/GroupWorks.vue")['default'] -export const LazyDetailMenu: typeof import("../components/Detail/Menu.vue")['default'] -export const LazyDetailMenuItem: typeof import("../components/Detail/MenuItem.vue")['default'] -export const LazyLoadingBookSkeletion: typeof import("../components/Loading/BookSkeletion.vue")['default'] -export const LazyLoadingCourseSkeleton: typeof import("../components/Loading/CourseSkeleton.vue")['default'] -export const LazyLoadingGroup: typeof import("../components/Loading/Group.vue")['default'] -export const LazyLoadingSkeleton: typeof import("../components/Loading/Skeleton.vue")['default'] -export const LazyPlayerAudio: typeof import("../components/Player/Audio.vue")['default'] -export const LazyPlayerLive: typeof import("../components/Player/Live.vue")['default'] -export const LazyPlayerVideo: typeof import("../components/Player/Video.vue")['default'] -export const LazyUiImage: typeof import("../components/Ui/Image.vue")['default'] -export const LazyUiMenu: typeof import("../components/Ui/Menu.vue")['default'] -export const LazyUiMenuItem: typeof import("../components/Ui/MenuItem.vue")['default'] -export const LazyUiTab: typeof import("../components/Ui/Tab.vue")['default'] -export const LazyUiTabItem: typeof import("../components/Ui/TabItem.vue")['default'] -export const LazyUserBuyList: typeof import("../components/User/BuyList.vue")['default'] -export const LazyUserCouponList: typeof import("../components/User/CouponList.vue")['default'] -export const LazyUserFavaList: typeof import("../components/User/FavaList.vue")['default'] -export const LazyUserHistoryList: typeof import("../components/User/HistoryList.vue")['default'] -export const LazyUserTestList: typeof import("../components/User/TestList.vue")['default'] -export const LazyUiCardBody: typeof import("../components/Ui/Card/Body.vue")['default'] -export const LazyUiCardFooter: typeof import("../components/Ui/Card/Footer.vue")['default'] -export const LazyUiCardHeader: typeof import("../components/Ui/Card/Header.vue")['default'] -export const LazyUiCard: typeof import("../components/Ui/Card/index.vue")['default'] -export const LazyNuxtWelcome: typeof import("../node_modules/@nuxt/ui-templates/dist/templates/welcome.vue")['default'] -export const LazyNuxtLayout: typeof import("../node_modules/nuxt/dist/app/components/layout")['default'] -export const LazyNuxtErrorBoundary: typeof import("../node_modules/nuxt/dist/app/components/nuxt-error-boundary")['default'] -export const LazyClientOnly: typeof import("../node_modules/nuxt/dist/app/components/client-only")['default'] -export const LazyServerPlaceholder: typeof import("../node_modules/nuxt/dist/app/components/server-placeholder")['default'] -export const LazyNuxtLink: typeof import("../node_modules/nuxt/dist/app/components/nuxt-link")['default'] -export const LazyNuxtLoadingIndicator: typeof import("../node_modules/nuxt/dist/app/components/nuxt-loading-indicator")['default'] -export const componentNames: string[] diff --git a/.nuxt/dev/index.mjs b/.nuxt/dev/index.mjs deleted file mode 100644 index 0c6ccec..0000000 --- a/.nuxt/dev/index.mjs +++ /dev/null @@ -1,526 +0,0 @@ -globalThis._importMeta_={url:import.meta.url,env:process.env};import 'file://E:/WebProject/nuxt3-edu/node_modules/node-fetch-native/dist/polyfill.mjs'; -import { Server } from 'http'; -import { tmpdir } from 'os'; -import { join } from 'path'; -import { mkdirSync } from 'fs'; -import { parentPort, threadId } from 'worker_threads'; -import { provider, isWindows } from 'file://E:/WebProject/nuxt3-edu/node_modules/std-env/dist/index.mjs'; -import { defineEventHandler, handleCacheHeaders, createEvent, createApp, createRouter, lazyEventHandler, eventHandler, useQuery } from 'file://E:/WebProject/nuxt3-edu/node_modules/h3/dist/index.mjs'; -import { createFetch as createFetch$1, Headers } from 'file://E:/WebProject/nuxt3-edu/node_modules/ohmyfetch/dist/node.mjs'; -import destr from 'file://E:/WebProject/nuxt3-edu/node_modules/destr/dist/index.mjs'; -import { createRouter as createRouter$1 } from 'file://E:/WebProject/nuxt3-edu/node_modules/radix3/dist/index.mjs'; -import { createCall, createFetch } from 'file://E:/WebProject/nuxt3-edu/node_modules/unenv/runtime/fetch/index.mjs'; -import { createHooks } from 'file://E:/WebProject/nuxt3-edu/node_modules/hookable/dist/index.mjs'; -import { hash } from 'file://E:/WebProject/nuxt3-edu/node_modules/ohash/dist/index.mjs'; -import { parseURL, withQuery, joinURL } from 'file://E:/WebProject/nuxt3-edu/node_modules/ufo/dist/index.mjs'; -import { createStorage } from 'file://E:/WebProject/nuxt3-edu/node_modules/unstorage/dist/index.mjs'; -import _unstorage_drivers_fs from 'file://E:/WebProject/nuxt3-edu/node_modules/unstorage/dist/drivers/fs.mjs'; -import { createRenderer } from 'file://E:/WebProject/nuxt3-edu/node_modules/vue-bundle-renderer/dist/index.mjs'; -import devalue from 'file://E:/WebProject/nuxt3-edu/node_modules/@nuxt/devalue/dist/devalue.mjs'; -import { renderToString } from 'file://E:/WebProject/nuxt3-edu/node_modules/vue/server-renderer/index.mjs'; -import { snakeCase } from 'file://E:/WebProject/nuxt3-edu/node_modules/scule/dist/index.mjs'; -import htmlTemplate from 'file://E:/WebProject/nuxt3-edu/.nuxt/views/document.template.mjs'; - -const _runtimeConfig = {"app":{"baseURL":"/","buildAssetsDir":"/_nuxt/","cdnURL":""},"nitro":{"routes":{},"envPrefix":"NUXT_"},"public":{}}; -const ENV_PREFIX = "NITRO_"; -const ENV_PREFIX_ALT = _runtimeConfig.nitro.envPrefix ?? process.env.NITRO_ENV_PREFIX ?? "_"; -const getEnv = (key) => { - const envKey = snakeCase(key).toUpperCase(); - return destr(process.env[ENV_PREFIX + envKey] ?? process.env[ENV_PREFIX_ALT + envKey]); -}; -function isObject(input) { - return typeof input === "object" && !Array.isArray(input); -} -function overrideConfig(obj, parentKey = "") { - for (const key in obj) { - const subKey = parentKey ? `${parentKey}_${key}` : key; - const envValue = getEnv(subKey); - if (isObject(obj[key])) { - if (isObject(envValue)) { - obj[key] = { ...obj[key], ...envValue }; - } - overrideConfig(obj[key], subKey); - } else { - obj[key] = envValue ?? obj[key]; - } - } -} -overrideConfig(_runtimeConfig); -const config = deepFreeze(_runtimeConfig); -const useRuntimeConfig = () => config; -function deepFreeze(object) { - const propNames = Object.getOwnPropertyNames(object); - for (const name of propNames) { - const value = object[name]; - if (value && typeof value === "object") { - deepFreeze(value); - } - } - return Object.freeze(object); -} - -const globalTiming = globalThis.__timing__ || { - start: () => 0, - end: () => 0, - metrics: [] -}; -function timingMiddleware(_req, res, next) { - const start = globalTiming.start(); - const _end = res.end; - res.end = (data, encoding, callback) => { - const metrics = [["Generate", globalTiming.end(start)], ...globalTiming.metrics]; - const serverTiming = metrics.map((m) => `-;dur=${m[1]};desc="${encodeURIComponent(m[0])}"`).join(", "); - if (!res.headersSent) { - res.setHeader("Server-Timing", serverTiming); - } - _end.call(res, data, encoding, callback); - }; - next(); -} - -const serverAssets = [{"baseName":"server","dir":"E:/WebProject/nuxt3-edu/server/assets"}]; - -const assets = createStorage(); - -for (const asset of serverAssets) { - assets.mount(asset.baseName, _unstorage_drivers_fs({ base: asset.dir })); -} - -const storage = createStorage({}); - -const useStorage = () => storage; - -storage.mount('/assets', assets); - -storage.mount('root', _unstorage_drivers_fs({"driver":"fs","base":"E:\\WebProject\\nuxt3-edu","ignore":["**/node_modules/**","**/.git/**"]})); -storage.mount('src', _unstorage_drivers_fs({"driver":"fs","base":"E:\\WebProject\\nuxt3-edu\\server","ignore":["**/node_modules/**","**/.git/**"]})); -storage.mount('build', _unstorage_drivers_fs({"driver":"fs","base":"E:\\WebProject\\nuxt3-edu\\.nuxt","ignore":["**/node_modules/**","**/.git/**"]})); -storage.mount('cache', _unstorage_drivers_fs({"driver":"fs","base":"E:\\WebProject\\nuxt3-edu\\.nuxt\\cache","ignore":["**/node_modules/**","**/.git/**"]})); - -const defaultCacheOptions = { - name: "_", - base: "/cache", - swr: true, - maxAge: 1 -}; -function defineCachedFunction(fn, opts) { - opts = { ...defaultCacheOptions, ...opts }; - const pending = {}; - const group = opts.group || "nitro"; - const name = opts.name || fn.name || "_"; - const integrity = hash([opts.integrity, fn, opts]); - async function get(key, resolver) { - const cacheKey = [opts.base, group, name, key + ".json"].filter(Boolean).join(":").replace(/:\/$/, ":index"); - const entry = await useStorage().getItem(cacheKey) || {}; - const ttl = (opts.maxAge ?? opts.maxAge ?? 0) * 1e3; - if (ttl) { - entry.expires = Date.now() + ttl; - } - const expired = entry.integrity !== integrity || ttl && Date.now() - (entry.mtime || 0) > ttl; - const _resolve = async () => { - if (!pending[key]) { - entry.value = void 0; - entry.integrity = void 0; - entry.mtime = void 0; - entry.expires = void 0; - pending[key] = Promise.resolve(resolver()); - } - entry.value = await pending[key]; - entry.mtime = Date.now(); - entry.integrity = integrity; - delete pending[key]; - useStorage().setItem(cacheKey, entry).catch((error) => console.error("[nitro] [cache]", error)); - }; - const _resolvePromise = expired ? _resolve() : Promise.resolve(); - if (opts.swr && entry.value) { - _resolvePromise.catch(console.error); - return Promise.resolve(entry); - } - return _resolvePromise.then(() => entry); - } - return async (...args) => { - const key = (opts.getKey || getKey)(...args); - const entry = await get(key, () => fn(...args)); - let value = entry.value; - if (opts.transform) { - value = await opts.transform(entry, ...args) || value; - } - return value; - }; -} -const cachedFunction = defineCachedFunction; -function getKey(...args) { - return args.length ? hash(args, {}) : ""; -} -function defineCachedEventHandler(handler, opts = defaultCacheOptions) { - const _opts = { - ...opts, - getKey: (event) => { - return decodeURI(parseURL(event.req.originalUrl || event.req.url).pathname).replace(/\/$/, "/index"); - }, - group: opts.group || "nitro/handlers", - integrity: [ - opts.integrity, - handler - ] - }; - const _cachedHandler = cachedFunction(async (incomingEvent) => { - const reqProxy = cloneWithProxy(incomingEvent.req, { headers: {} }); - const resHeaders = {}; - const resProxy = cloneWithProxy(incomingEvent.res, { - statusCode: 200, - getHeader(name) { - return resHeaders[name]; - }, - setHeader(name, value) { - resHeaders[name] = value; - return this; - }, - getHeaderNames() { - return Object.keys(resHeaders); - }, - hasHeader(name) { - return name in resHeaders; - }, - removeHeader(name) { - delete resHeaders[name]; - }, - getHeaders() { - return resHeaders; - } - }); - const event = createEvent(reqProxy, resProxy); - event.context = incomingEvent.context; - const body = await handler(event); - const headers = event.res.getHeaders(); - headers.Etag = `W/"${hash(body)}"`; - headers["Last-Modified"] = new Date().toUTCString(); - const cacheControl = []; - if (opts.swr) { - if (opts.maxAge) { - cacheControl.push(`s-maxage=${opts.maxAge}`); - } - if (opts.staleMaxAge) { - cacheControl.push(`stale-while-revalidate=${opts.staleMaxAge}`); - } else { - cacheControl.push("stale-while-revalidate"); - } - } else if (opts.maxAge) { - cacheControl.push(`max-age=${opts.maxAge}`); - } - if (cacheControl.length) { - headers["Cache-Control"] = cacheControl.join(", "); - } - const cacheEntry = { - code: event.res.statusCode, - headers, - body - }; - return cacheEntry; - }, _opts); - return defineEventHandler(async (event) => { - const response = await _cachedHandler(event); - if (event.res.headersSent || event.res.writableEnded) { - return response.body; - } - if (handleCacheHeaders(event, { - modifiedTime: new Date(response.headers["Last-Modified"]), - etag: response.headers.etag, - maxAge: opts.maxAge - })) { - return; - } - event.res.statusCode = response.code; - for (const name in response.headers) { - event.res.setHeader(name, response.headers[name]); - } - return response.body; - }); -} -function cloneWithProxy(obj, overrides) { - return new Proxy(obj, { - get(target, property, receiver) { - if (property in overrides) { - return overrides[property]; - } - return Reflect.get(target, property, receiver); - }, - set(target, property, value, receiver) { - if (property in overrides) { - overrides[property] = value; - return true; - } - return Reflect.set(target, property, value, receiver); - } - }); -} -const cachedEventHandler = defineCachedEventHandler; - -const plugins = [ - -]; - -function hasReqHeader(req, header, includes) { - const value = req.headers[header]; - return value && typeof value === "string" && value.toLowerCase().includes(includes); -} -function isJsonRequest(event) { - return hasReqHeader(event.req, "accept", "application/json") || hasReqHeader(event.req, "user-agent", "curl/") || hasReqHeader(event.req, "user-agent", "httpie/") || event.req.url?.endsWith(".json") || event.req.url?.includes("/api/"); -} -function normalizeError(error) { - const cwd = process.cwd(); - const stack = (error.stack || "").split("\n").splice(1).filter((line) => line.includes("at ")).map((line) => { - const text = line.replace(cwd + "/", "./").replace("webpack:/", "").replace("file://", "").trim(); - return { - text, - internal: line.includes("node_modules") && !line.includes(".cache") || line.includes("internal") || line.includes("new Promise") - }; - }); - const statusCode = error.statusCode || 500; - const statusMessage = error.statusMessage ?? (statusCode === 404 ? "Route Not Found" : "Internal Server Error"); - const message = error.message || error.toString(); - return { - stack, - statusCode, - statusMessage, - message - }; -} - -const errorHandler = (async function errorhandler(_error, event) { - const { stack, statusCode, statusMessage, message } = normalizeError(_error); - const errorObject = { - url: event.req.url, - statusCode, - statusMessage, - message, - description: statusCode !== 404 ? `
${stack.map((i) => `${i.text}`).join("\n")}
` : "", - data: _error.data - }; - event.res.statusCode = errorObject.statusCode; - event.res.statusMessage = errorObject.statusMessage; - if (errorObject.statusCode !== 404) { - console.error("[nuxt] [request error]", errorObject.message + "\n" + stack.map((l) => " " + l.text).join(" \n")); - } - if (isJsonRequest(event)) { - event.res.setHeader("Content-Type", "application/json"); - event.res.end(JSON.stringify(errorObject)); - return; - } - const url = withQuery("/__nuxt_error", errorObject); - const html = await $fetch(url).catch((error) => { - console.error("[nitro] Error while generating error response", error); - return errorObject.statusMessage; - }); - event.res.setHeader("Content-Type", "text/html;charset=UTF-8"); - event.res.end(html); -}); - -const _lazy_0qTkuL = () => Promise.resolve().then(function () { return renderer$1; }); - -const handlers = [ - { route: '/__nuxt_error', handler: _lazy_0qTkuL, lazy: true, middleware: false, method: undefined }, - { route: '/**', handler: _lazy_0qTkuL, lazy: true, middleware: false, method: undefined } -]; - -function createNitroApp() { - const config = useRuntimeConfig(); - const hooks = createHooks(); - const h3App = createApp({ - debug: destr(true), - onError: errorHandler - }); - h3App.use(config.app.baseURL, timingMiddleware); - const router = createRouter(); - const routerOptions = createRouter$1({ routes: config.nitro.routes }); - for (const h of handlers) { - let handler = h.lazy ? lazyEventHandler(h.handler) : h.handler; - const referenceRoute = h.route.replace(/:\w+|\*\*/g, "_"); - const routeOptions = routerOptions.lookup(referenceRoute) || {}; - if (routeOptions.swr) { - handler = cachedEventHandler(handler, { - group: "nitro/routes" - }); - } - if (h.middleware || !h.route) { - const middlewareBase = (config.app.baseURL + (h.route || "/")).replace(/\/+/g, "/"); - h3App.use(middlewareBase, handler); - } else { - router.use(h.route, handler, h.method); - } - } - h3App.use(config.app.baseURL, router); - const localCall = createCall(h3App.nodeHandler); - const localFetch = createFetch(localCall, globalThis.fetch); - const $fetch = createFetch$1({ fetch: localFetch, Headers, defaults: { baseURL: config.app.baseURL } }); - globalThis.$fetch = $fetch; - const app = { - hooks, - h3App, - router, - localCall, - localFetch - }; - for (const plugin of plugins) { - plugin(app); - } - return app; -} -const nitroApp = createNitroApp(); - -const server = new Server(nitroApp.h3App.nodeHandler); -function getAddress() { - if (provider === "stackblitz" || process.env.NITRO_NO_UNIX_SOCKET) { - return "0"; - } - const socketName = `worker-${process.pid}-${threadId}.sock`; - if (isWindows) { - return join("\\\\.\\pipe\\nitro", socketName); - } else { - const socketDir = join(tmpdir(), "nitro"); - mkdirSync(socketDir, { recursive: true }); - return join(socketDir, socketName); - } -} -const listenAddress = getAddress(); -server.listen(listenAddress, () => { - const _address = server.address(); - parentPort.postMessage({ - event: "listen", - address: typeof _address === "string" ? { socketPath: _address } : { host: "localhost", port: _address.port } - }); -}); -{ - process.on("unhandledRejection", (err) => console.error("[nitro] [dev] [unhandledRejection]", err)); - process.on("uncaughtException", (err) => console.error("[nitro] [dev] [uncaughtException]", err)); -} - -function buildAssetsURL(...path) { - return joinURL(publicAssetsURL(), useRuntimeConfig().app.buildAssetsDir, ...path); -} -function publicAssetsURL(...path) { - const publicBase = useRuntimeConfig().app.cdnURL || useRuntimeConfig().app.baseURL; - return path.length ? joinURL(publicBase, ...path) : publicBase; -} - -const getClientManifest = () => import('file://E:/WebProject/nuxt3-edu/.nuxt/dist/server/client.manifest.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r); -const getServerEntry = () => import('file://E:/WebProject/nuxt3-edu/.nuxt/dist/server/server.mjs').then((r) => r.default || r); -const getSSRRenderer = lazyCachedFunction(async () => { - const clientManifest = await getClientManifest(); - if (!clientManifest) { - throw new Error("client.manifest is not available"); - } - const createSSRApp = await getServerEntry(); - if (!createSSRApp) { - throw new Error("Server bundle is not available"); - } - const renderer = createRenderer(createSSRApp, { - clientManifest, - renderToString: renderToString$1, - publicPath: buildAssetsURL() - }); - async function renderToString$1(input, context) { - const html = await renderToString(input, context); - if (process.env.NUXT_VITE_NODE_OPTIONS) { - renderer.rendererContext.updateManifest(await getClientManifest()); - } - return `
${html}
`; - } - return renderer; -}); -const getSPARenderer = lazyCachedFunction(async () => { - const clientManifest = await getClientManifest(); - const renderToString = (ssrContext) => { - const config = useRuntimeConfig(); - ssrContext.payload = { - serverRendered: false, - config: { - public: config.public, - app: config.app - } - }; - let entryFiles = Object.values(clientManifest).filter((fileValue) => fileValue.isEntry); - if ("all" in clientManifest && "initial" in clientManifest) { - entryFiles = clientManifest.initial.map((file) => ({ file })); - } - return Promise.resolve({ - html: '
', - renderResourceHints: () => "", - renderStyles: () => entryFiles.flatMap(({ css }) => css).filter((css) => css != null).map((file) => ``).join(""), - renderScripts: () => entryFiles.map(({ file }) => { - const isMJS = !file.endsWith(".js"); - return ` \ No newline at end of file diff --git a/app/router.options.js b/app/router.options.js index 2fc2160..651d6e9 100644 --- a/app/router.options.js +++ b/app/router.options.js @@ -1,11 +1,12 @@ -// 点击分页返回顶部 export default { scrollBehavior(to, from, savedPosition) { - //在按下前进/后退按钮,就会触发这个方法实现前进后退功能 + // 在按下 后退/前进 按钮时。就会像浏览器的原生表现那样 if (savedPosition) { return savedPosition; - } else { - return { top: 0 }; } + + return { + top: 0, + }; }, }; diff --git a/assets/icons/top.png b/assets/icons/top.png deleted file mode 100644 index 53ac35f..0000000 Binary files a/assets/icons/top.png and /dev/null differ diff --git a/assets/css/main.css b/assets/main.css similarity index 100% rename from assets/css/main.css rename to assets/main.css diff --git a/components/Banner.vue b/components/Banner.vue index f0c228d..e10e9cd 100644 --- a/components/Banner.vue +++ b/components/Banner.vue @@ -1,7 +1,6 @@ -