"use client"; import React, { useEffect, useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleRight } from "@fortawesome/free-solid-svg-icons"; import { Avatar, Image, Toast } from "antd-mobile"; import { useRouter, useSearchParams } from "next/navigation"; import { get } from "@/utils/storeInfo"; import requireAPI from "@/utils/requireAPI"; const My = () => { const [userInfo, setUserInfo] = useState({}); const router = useRouter(); useEffect(() => { const userInfo = get("account"); if (userInfo) { // setUserInfo(userInfo); getData(userInfo); } // getData(userInfo); }, []); const getData = async (oldUserInfo) => { const data = await requireAPI("POST", "/api/account_relation/count", null, true); const account = await requireAPI("POST", "/api/account/list_by_mid", null, true); if (data.ret === -1) { Toast.show({ icon: "fail", content: data.msg, position: "top", }); return; } setUserInfo({ ...oldUserInfo, ...data.data,...account.data.account }); }; return (
router.push("my/editUserProfile/selectUserProfileItem") } >
router.push("my/setting")} >
{userInfo?.role === 3 ? (
router.push("profile/" + userInfo.mid)} >

{userInfo.name}

{userInfo.user_id}
{ // searchParams.append(); // router.back(); }} />
) : (

{userInfo.name}

{userInfo.user_id}
)} {/* 会员用户 */} {/*
*/} {/* 普通用户 */}
); }; export default My;