mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
index.html添加百秒级时间戳,防止被浏览器缓存
This commit is contained in:
@@ -3,3 +3,22 @@ window.globalConfig = {
|
|||||||
"BaseApiUrl": "",
|
"BaseApiUrl": "",
|
||||||
"BaseWsUrl": ""
|
"BaseWsUrl": ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// index.html添加百秒级时间戳,防止被浏览器缓存
|
||||||
|
!function(){
|
||||||
|
let t = "t=" + new Date().getTime().toString().substring(0, 8)
|
||||||
|
let search = location.search;
|
||||||
|
let m = search && search.match(/t=\d*/g)
|
||||||
|
|
||||||
|
if (m[0]){
|
||||||
|
if( m[0] !== t){
|
||||||
|
location.search = search.replace(m[0], t)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(search.indexOf('?') > -1){
|
||||||
|
location.search = search + '&'+t
|
||||||
|
}else{
|
||||||
|
location.search = t
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user