mirror of
https://github.com/labring/laf.git
synced 2026-02-01 16:57:03 +00:00
feat(web): hide phone number info (#1111)
This commit is contained in:
parent
425b782374
commit
e4d8141de2
@ -4,7 +4,7 @@ import clsx from "clsx";
|
||||
import { t } from "i18next";
|
||||
|
||||
import { COLOR_MODE } from "@/constants";
|
||||
import { formatDate } from "@/utils/format";
|
||||
import { formatDate, hidePhoneNumber } from "@/utils/format";
|
||||
|
||||
import AuthDetail from "./AuthDetail";
|
||||
|
||||
@ -57,7 +57,7 @@ export default function UserInfo() {
|
||||
<Box className="mb-20 mt-8 text-lg">
|
||||
<HStack spacing={8}>
|
||||
<span className="w-[80px] text-grayModern-500">{t("SettingPanel.Tel")}:</span>
|
||||
<span>{userInfo?.phone ? userInfo.phone : t("NoInfo")}</span>
|
||||
<span>{userInfo?.phone ? hidePhoneNumber(userInfo.phone) : t("NoInfo")}</span>
|
||||
</HStack>
|
||||
<HStack spacing={8} className="mt-2">
|
||||
<span className="w-[80px] text-grayModern-500">{t("SettingPanel.Registered")}:</span>
|
||||
|
||||
@ -4,6 +4,7 @@ import { Button, useColorMode } from "@chakra-ui/react";
|
||||
import clsx from "clsx";
|
||||
|
||||
import { COLOR_MODE } from "@/constants";
|
||||
import { hidePhoneNumber } from "@/utils/format";
|
||||
|
||||
import CreateAppModal from "../CreateAppModal";
|
||||
|
||||
@ -31,7 +32,8 @@ function Empty() {
|
||||
<div style={{ height: "75vh", minHeight: "500px" }}>
|
||||
<div className="flex h-full flex-col items-center justify-center">
|
||||
<h2 className="text-3xl font-bold">
|
||||
{t("HomePanel.Hello")} 👋 , {userInfo?.profile?.name || userInfo?.username} ,{" "}
|
||||
{t("HomePanel.Hello")} 👋 ,{" "}
|
||||
{hidePhoneNumber(userInfo?.profile?.name || userInfo?.username || "")} ,
|
||||
{t("HomePanel.Welcome")}
|
||||
</h2>
|
||||
<p className="mx-auto mb-8 mt-10 w-[460px] text-xl">{t("HomePanel.Introduction")}</p>
|
||||
|
||||
@ -87,3 +87,7 @@ export function formatPrice(price: number) {
|
||||
export function convertMoney(money: number) {
|
||||
return money * 100;
|
||||
}
|
||||
|
||||
export function hidePhoneNumber(phone: string) {
|
||||
return phone.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user