2025-09-24 14:14:14 +08:00
|
|
|
import { useState, useEffect } from "react";
|
|
|
|
|
import "./index.css";
|
|
|
|
|
|
|
|
|
|
const Portfolio = () => {
|
|
|
|
|
const [iframeSrc, setIframeSrc] = useState("");
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// 添加时间戳参数来破坏缓存
|
|
|
|
|
const timestamp = new Date().getTime();
|
2025-10-17 14:36:25 +08:00
|
|
|
setIframeSrc(`https://du9uay.github.io/personal-resume-transportation/?t=${timestamp}`);
|
2025-09-24 14:14:14 +08:00
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const handleRefresh = () => {
|
|
|
|
|
// 手动刷新iframe内容
|
|
|
|
|
const timestamp = new Date().getTime();
|
2025-10-17 14:36:25 +08:00
|
|
|
setIframeSrc(`https://du9uay.github.io/personal-resume-transportation/?t=${timestamp}`);
|
2025-09-24 14:14:14 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="user-portfolio-page">
|
|
|
|
|
{iframeSrc && (
|
|
|
|
|
<iframe
|
|
|
|
|
key={iframeSrc} // 使用key强制重新渲染iframe
|
|
|
|
|
src={iframeSrc}
|
|
|
|
|
style={{
|
|
|
|
|
width: "100%",
|
|
|
|
|
height: "100vh",
|
|
|
|
|
border: "none",
|
|
|
|
|
display: "block"
|
|
|
|
|
}}
|
|
|
|
|
title="个人简历"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Portfolio;
|