update: remove basePath /html/

main
fadeaway 5 months ago
parent 44023b8589
commit 149ee5cff0

2
.gitignore vendored

@ -12,7 +12,7 @@
# next.js # next.js
/.next/ /.next/
/out/ /out/
/html/ /dist/
*.zip *.zip
*.rar *.rar

@ -1,12 +1,7 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const basePath = '/html';
const nextConfig = { const nextConfig = {
output: 'export', output: 'export',
basePath, ...(process.env.NODE_ENV === 'production' ? { distDir: 'dist' } : {}),
env: { basePath },
...(process.env.NODE_ENV === 'production' ? { distDir: 'html' } : {}),
}; };
export default nextConfig; export default nextConfig;

@ -3,8 +3,8 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "rm -rf html & next dev -p 80", "dev": "rm -rf dist & next dev -p 80",
"build": "rm -rf html & next build", "build": "rm -rf dist & next build",
"start": "next start -p 80", "start": "next start -p 80",
"lint": "eslint src --fix --ext .ts,.tsx,.js,.jsx,.mdx,.md,.json,.mjs --max-warnings 0" "lint": "eslint src --fix --ext .ts,.tsx,.js,.jsx,.mdx,.md,.json,.mjs --max-warnings 0"
}, },

@ -3,7 +3,7 @@
import { useRef } from 'react'; import { useRef } from 'react';
import Link from 'next/link'; import Link from 'next/link';
// import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import AppLogo from '@/components/AppLogo'; import AppLogo from '@/components/AppLogo';
import ImageWithBasePath from '@/components/ImageWithBasePath'; import ImageWithBasePath from '@/components/ImageWithBasePath';
@ -14,7 +14,7 @@ import { download } from '@/utils/download';
import useUA from '@/hooks/useUA'; import useUA from '@/hooks/useUA';
export default function Home() { export default function Home() {
// const router = useRouter(); const router = useRouter();
const firstScreenRef = useRef<HTMLDivElement>(null); const firstScreenRef = useRef<HTMLDivElement>(null);
const { inWX } = useUA(); const { inWX } = useUA();
@ -22,8 +22,7 @@ export default function Home() {
if (!inWX) { if (!inWX) {
download(); download();
} else { } else {
// router.push('/download'); router.push('/download');
window.location.href = '/html/download.html';
} }
}; };
@ -37,8 +36,7 @@ export default function Home() {
{/* 首屏 */} {/* 首屏 */}
<div <div
ref={firstScreenRef} ref={firstScreenRef}
className="relative w-full min-h-screen flex flex-col items-center bg-center bg-cover" className="relative w-full min-h-screen flex flex-col items-center bg-[url(/img/index_background.png)] bg-center bg-cover"
style={{ backgroundImage: `url(${process.env.basePath}/img/index_background.png)` }}
> >
{/* title */} {/* title */}
{!inWX && <h1 className="text-center text-[17px] h-[44px] leading-[44px]"></h1>} {!inWX && <h1 className="text-center text-[17px] h-[44px] leading-[44px]"></h1>}

@ -2,12 +2,12 @@
import { useState } from 'react'; import { useState } from 'react';
// import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import useUA from '@/hooks/useUA'; import useUA from '@/hooks/useUA';
export default function EnterQueyueBtn() { export default function EnterQueyueBtn() {
// const router = useRouter(); const router = useRouter();
const [opening, setOpening] = useState(false); const [opening, setOpening] = useState(false);
const { inWX } = useUA(); const { inWX } = useUA();
@ -20,10 +20,8 @@ export default function EnterQueyueBtn() {
if (result) { if (result) {
window.location.href = `queyue://play/${songId}`; // 打开某手机上的某个app应用 window.location.href = `queyue://play/${songId}`; // 打开某手机上的某个app应用
setTimeout(function () { setTimeout(function () {
// alert('打开应用无效跳转下载页'); router.push('/download');
// router.push('/download'); }, 500);
window.location.href = '/html/download.html';
}, 2000);
setOpening(false); setOpening(false);
} else { } else {
setOpening(false); setOpening(false);

@ -1,6 +1,6 @@
import Image from 'next/image'; import Image from 'next/image';
export default function ImageWithBasePath(props: any) { export default function ImageWithBasePath(props: any) {
const imgSrc = process.env.NODE_ENV === 'development' ? `${process.env.basePath}/${props?.src || ''}` : props?.src; const imgSrc = props?.src;
return <Image {...props} src={imgSrc} alt={props?.alt} />; return <Image {...props} src={imgSrc} alt={props?.alt} />;
} }

@ -1,14 +1,13 @@
'use client'; 'use client';
// import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import ImageWithBasePath from '@/components/ImageWithBasePath'; import ImageWithBasePath from '@/components/ImageWithBasePath';
export default function InviteBanner() { export default function InviteBanner() {
// const router = useRouter(); const router = useRouter();
const handleClick = () => { const handleClick = () => {
// router.push('/download'); router.push('/');
window.location.href = '/html/index.html';
}; };
return ( return (
<div <div

@ -1,14 +1,13 @@
'use client'; 'use client';
// import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import ImageWithBasePath from '@/components/ImageWithBasePath'; import ImageWithBasePath from '@/components/ImageWithBasePath';
export default function JournalComment({ journalInfo }: { journalInfo: any }) { export default function JournalComment({ journalInfo }: { journalInfo: any }) {
// const router = useRouter(); const router = useRouter();
const handleClick = () => { const handleClick = () => {
// router.push('/download'); router.push('/download');
window.location.href = '/html/download.html';
}; };
return ( return (
<section className="fixed bottom-0 left-[50%] translate-x-[-50%] z-[999] w-full max-w-screen-sm flex items-center border-t-[0.8px] border-[#00000019] pt-[14px] pb-[35px] px-[18px] bg-white"> <section className="fixed bottom-0 left-[50%] translate-x-[-50%] z-[999] w-full max-w-screen-sm flex items-center border-t-[0.8px] border-[#00000019] pt-[14px] pb-[35px] px-[18px] bg-white">

@ -1,14 +1,13 @@
'use client'; 'use client';
// import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import ImageWithBasePath from '@/components/ImageWithBasePath'; import ImageWithBasePath from '@/components/ImageWithBasePath';
export default function MusicBanner() { export default function MusicBanner() {
// const router = useRouter(); const router = useRouter();
const handleClick = () => { const handleClick = () => {
// router.push('/download'); router.push('/');
window.location.href = '/html/index.html';
}; };
return ( return (
<div <div

@ -1,7 +1,7 @@
'use client'; 'use client';
// import { useRouter } from 'next/navigation';
import Image from 'next/image'; import Image from 'next/image';
import { useRouter } from 'next/navigation';
import ImageWithBasePath from '@/components/ImageWithBasePath'; import ImageWithBasePath from '@/components/ImageWithBasePath';
@ -12,15 +12,14 @@ import { useJournalAudioContext } from '@/context/JournalAudioContext';
export default function SongItem(props: { data: ISong }) { export default function SongItem(props: { data: ISong }) {
const song = props?.data || {}; const song = props?.data || {};
const { id, pic, title, artist, album } = song; const { id, pic, title, artist, album } = song;
// const router = useRouter(); const router = useRouter();
const { curSong, setCurSong, playing, setPlaying } = useJournalAudioContext(); const { curSong, setCurSong, playing, setPlaying } = useJournalAudioContext();
const activeTextColor = curSong?.id && id && curSong?.id === id ? 'text-[#C43737ff]' : ''; const activeTextColor: string = curSong?.id && id && curSong?.id === id ? 'text-[#C43737ff]' : '';
// 点击歌曲封面跳转到单曲页面 // 点击歌曲封面跳转到单曲页面
const handleCoverClick = () => { const handleCoverClick = () => {
// router.push(`/music?id=${id}`); router.push(`/music?id=${id}`);
window.location.href = `/html/music.html?id=${id}`;
}; };
// 点击歌曲信息播放歌曲 // 点击歌曲信息播放歌曲
@ -31,8 +30,7 @@ export default function SongItem(props: { data: ISong }) {
// 点击右侧图标,弹出弹窗(目前先跳转到下载页) // 点击右侧图标,弹出弹窗(目前先跳转到下载页)
const handleBudsClick = () => { const handleBudsClick = () => {
// router.push('/download'); router.push('/download');
window.location.href = '/html/download.html';
}; };
return ( return (

@ -1,10 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"lib": [ "lib": ["dom", "dom.iterable", "esnext"],
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@ -22,20 +18,9 @@
} }
], ],
"paths": { "paths": {
"@/*": [ "@/*": ["./src/*"]
"./src/*"
]
} }
}, },
"include": [ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "dist/types/**/*.ts", "out/types/**/*.ts"],
"next-env.d.ts", "exclude": ["node_modules"]
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"html/types/**/*.ts",
"out/types/**/*.ts"
],
"exclude": [
"node_modules"
]
} }

Loading…
Cancel
Save