紧急处理 GeoIP API 问题

This commit is contained in:
naiba
2021-07-05 13:44:21 +08:00
parent 8d0e269b73
commit 557cccd770
5 changed files with 16 additions and 15 deletions

View File

@@ -217,9 +217,12 @@
return this.cache[percent]
},
readableBytes(bytes) {
if (!bytes) {
return '0B'
}
var i = Math.floor(Math.log(bytes) / Math.log(1024)),
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
return (bytes / Math.pow(1024, i)).toFixed(0) + ' ' + sizes[i];
sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + sizes[i];
},
DarkMode() {
const hour = new Date(Date.now()).getHours()