fix: 静态资源加缓存破坏版本号,解决浏览器缓存旧 JS 导致功能不生效
- 启动时生成 AssetVersion(base36 时间戳),注入模板 {{.V}}
- 所有 JS/CSS 引用加 ?v={{.V}},重启即刷新缓存
- 涉及前端、管理后台共 12 个模板文件
This commit is contained in:
@ -42,7 +42,7 @@
|
||||
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>
|
||||
</button>
|
||||
|
||||
<script src="/static/js/common.js"></script>
|
||||
<script src="/static/js/login.js"></script>
|
||||
<script src="/static/js/common.js?v={{.V}}"></script>
|
||||
<script src="/static/js/login.js?v={{.V}}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>
|
||||
</button>
|
||||
|
||||
<script src="/static/js/common.js"></script>
|
||||
<script src="/static/js/register.js"></script>
|
||||
<script src="/static/js/common.js?v={{.V}}"></script>
|
||||
<script src="/static/js/register.js?v={{.V}}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user