我的页面优化

This commit is contained in:
禺狨 2023-07-04 15:50:25 +08:00
parent fa47b63769
commit b851789171
3 changed files with 25 additions and 6 deletions

View File

@ -15,8 +15,8 @@ const MemberPage = () => {
const navigate = useNavigate();
const [loading, setLoading] = useState<boolean>(false);
const [currentDepartment, setCurrentDepartment] = useState<string>("");
const [visible, setVisible] = useState(false);
const [init, setInit] = useState(false);
const [visible, setVisible] = useState<boolean>(false);
const [init, setInit] = useState<boolean>(false);
const [stats, setStats] = useState<any>({});
const [fileList, setFileList] = useState<ImageUploadItem[]>([
{
@ -136,7 +136,7 @@ const MemberPage = () => {
</div>
</>
)}
{init && user.name && (
{init && (
<>
<Image
width={100}
@ -146,10 +146,10 @@ const MemberPage = () => {
marginRight: 20,
}}
fit="cover"
src={user.avatar}
src={user?.avatar}
/>
<div className={styles["other-cont"]}>
<div className={styles["name"]}>{user.name}</div>
<div className={styles["name"]}>{user?.name}</div>
<div className={styles["departments"]}>
<div className={styles["department-name"]}>
{currentDepartment}

19
src/playedu.d.ts vendored
View File

@ -53,6 +53,25 @@ declare global {
created_at: string;
updated_at: string;
}
interface UserModel {
id: number;
name: string;
avatar: string;
credit1: number;
email: string;
create_city: string;
create_ip: string;
id_card: string;
is_active: number;
is_lock: number;
is_set_password: number;
is_verify: number;
created_at: string;
updated_at: string;
login_at: string | null;
verify_at: string | null;
}
}
export {};

View File

@ -8,7 +8,7 @@ import {
} from "../../utils/index";
type UserStoreInterface = {
user: null;
user: UserModel | null;
departments: string[];
currentDepId: number;
isLogin: boolean;