🐞 fix:
This commit is contained in:
parent
562a95ca9c
commit
61df3f063a
|
@ -1,6 +1,6 @@
|
|||
import classes from "./Home.module.css";
|
||||
import useUserStore from "@/store/User";
|
||||
import { cn, copyText, shortenString } from "@/utils";
|
||||
import { cn, copyText, padWithZero, shortenString } from "@/utils";
|
||||
import { useWeb3Modal } from "@web3modal/wagmi/react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
@ -261,7 +261,7 @@ export default function () {
|
|||
{userData?.nftId ? (
|
||||
<div className={classes.nftToken_content_nft}>
|
||||
<div className={classes.nftToken_content_nft_top}>
|
||||
<span># {userData?.nftId}</span>
|
||||
<span># {padWithZero(userData?.nftId)}</span>
|
||||
<span
|
||||
onClick={() => {
|
||||
navigate("/mint");
|
||||
|
|
|
@ -113,3 +113,8 @@ export function getUrlParameterByName(name: string, url?: string) {
|
|||
console.log("url params:", results);
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
export function padWithZero(num: number) {
|
||||
// 将数字转换为字符串,并在前面补足零使总长度为5
|
||||
return String(num).padStart(5, "0");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue