deving
This commit is contained in:
@@ -166,4 +166,26 @@ function formatFileSize(bytes) {
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
// 跳转到上传页面
|
||||
async function goToUpload() {
|
||||
try {
|
||||
// 上传页面需要GET请求,直接跳转
|
||||
window.location.href = '/';
|
||||
} catch (error) {
|
||||
console.error('跳转失败:', error);
|
||||
window.location.href = '/';
|
||||
}
|
||||
}
|
||||
|
||||
// 跳转到主页
|
||||
async function goToHome() {
|
||||
try {
|
||||
// 主页需要GET请求,直接跳转
|
||||
window.location.href = '/';
|
||||
} catch (error) {
|
||||
console.error('跳转失败:', error);
|
||||
window.location.href = '/';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user