debug
This commit is contained in:
parent
0d8cda9787
commit
2da7bdb57b
|
@ -13,9 +13,12 @@ import qrcode from "@/public/images/qrcode.png";
|
|||
import Footer from "@/components/Footer";
|
||||
|
||||
export default function Home() {
|
||||
const [currentUserAgent, setCurrentUserAgent] = useState();
|
||||
const [deviceType, setDeviceType] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
const userAgent = navigator.userAgent;
|
||||
setCurrentUserAgent(userAgent);
|
||||
//区分设备类型
|
||||
if (/Android/i.test(userAgent)) {
|
||||
setDeviceType("Android");
|
||||
|
@ -57,6 +60,8 @@ export default function Home() {
|
|||
</div>
|
||||
<div className="flex flex-col flex-1 py-16 items-center justify-around z-10">
|
||||
<Image className="w-96" src={slogan} priority alt="" />
|
||||
<p className="text-white">{deviceType}</p>
|
||||
<p className="text-white">{currentUserAgent}</p>
|
||||
{deviceType === "pc" && (
|
||||
<div className="flex flex-row gap-20">
|
||||
<a
|
||||
|
|
Loading…
Reference in New Issue