update: remove basePath /html/

main
fadeaway 7 months ago
parent 44023b8589
commit 149ee5cff0

2
.gitignore vendored

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

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

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

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

@ -1,6 +1,6 @@
import Image from 'next/image';
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} />;
}

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

@ -1,14 +1,13 @@
'use client';
// import { useRouter } from 'next/navigation';
import { useRouter } from 'next/navigation';
import ImageWithBasePath from '@/components/ImageWithBasePath';
export default function JournalComment({ journalInfo }: { journalInfo: any }) {
// const router = useRouter();
const router = useRouter();
const handleClick = () => {
// router.push('/download');
window.location.href = '/html/download.html';
router.push('/download');
};
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">

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

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

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

Loading…
Cancel
Save