Skip to content

Commit 1276c24

Browse files
committed
fix bug: 前端页面未更新
1 parent ec03b27 commit 1276c24

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

static/index.html

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
<link rel="preconnect" href="https://fonts.googleapis.com">
99
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1010
<link href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet">
11-
<link rel="stylesheet" href="/static/css/styles.css?v=0.4.0">
12-
<link rel="stylesheet" href="/static/css/calendar.css?v=0.4.0">
11+
12+
<!-- 动态加载 CSS 以避免缓存 -->
13+
<script>
14+
(function() {
15+
var v = Date.now();
16+
document.write('<link rel="stylesheet" href="/static/css/styles.css?v=' + v + '">');
17+
document.write('<link rel="stylesheet" href="/static/css/calendar.css?v=' + v + '">');
18+
})();
19+
</script>
1320
</head>
1421
<body>
1522
<!-- 登录界面 -->
@@ -514,7 +521,14 @@ <h2>编辑任务</h2>
514521
});
515522
})();
516523
</script>
517-
<script src="/static/js/app.js?v=0.4.0"></script>
518-
<script src="/static/js/calendar.js?v=0.4.0"></script>
524+
525+
<!-- 动态加载 JS 以避免缓存 -->
526+
<script>
527+
(function() {
528+
var v = Date.now();
529+
document.write('<script src="/static/js/app.js?v=' + v + '"><\/script>');
530+
document.write('<script src="/static/js/calendar.js?v=' + v + '"><\/script>');
531+
})();
532+
</script>
519533
</body>
520534
</html>

0 commit comments

Comments
 (0)