静态资源加修改时间版本号,修复部署后浏览器缓存旧 JS 的问题
页面 JS/CSS 引用统一改为 asset_url()(附加 ?v=filemtime): 部署更新文件后浏览器自动拉取新版本,避免出现"新按钮点击无反应"等旧缓存现象。
This commit is contained in:
1 parent
3a13656cfb
commit
dbf70f602e
24 files changed
+53
-42
No files matched your search
@@ -25,9 +25,9 @@ $page_title = $page_title ?? '首页';
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title><?php echo SITE_NAME; ?> - <?php echo $page_title; ?></title>
|
||||
<link rel="stylesheet" href="/assets/css/style.css">
|
||||
<link rel="stylesheet" href="<?php echo asset_url('/assets/css/style.css'); ?>">
|
||||
<?php if ($user_type === 'admin'): ?>
|
||||
<link rel="stylesheet" href="/assets/css/admin.css">
|
||||
<link rel="stylesheet" href="<?php echo asset_url('/assets/css/admin.css'); ?>">
|
||||
<?php endif; ?>
|
||||
</head>
|
||||
<body>
|
||||
@@ -81,8 +81,8 @@ $page_title = $page_title ?? '首页';
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script src="/assets/js/common.js"></script>
|
||||
<script src="/assets/js/modules/utils.js"></script>
|
||||
<script src="<?php echo asset_url('/assets/js/common.js'); ?>"></script>
|
||||
<script src="<?php echo asset_url('/assets/js/modules/utils.js'); ?>"></script>
|
||||
<?php if ($user_type === 'admin'): ?>
|
||||
<script>
|
||||
window.USER_PERMISSIONS = <?php
|
||||
|
||||
Reference in new issue
Block a user