mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-12 16:18:45 +08:00
feat:增加转存资源列表展示与选择
This commit is contained in:
9
frontend/src/utils/index.ts
Normal file
9
frontend/src/utils/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const formattedFileSize = (size: number): string => {
|
||||
if (size < 1024 * 1024) {
|
||||
return `${(size / 1024).toFixed(2)}KB`;
|
||||
}
|
||||
if (size < 1024 * 1024 * 1024) {
|
||||
return `${(size / 1024 / 1024).toFixed(2)}MB`;
|
||||
}
|
||||
return `${(size / 1024 / 1024 / 1024).toFixed(2)}GB`;
|
||||
};
|
||||
@@ -4,7 +4,7 @@ import { RequestResult } from "../types/response";
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL as string,
|
||||
timeout: 9000,
|
||||
timeout: 16000,
|
||||
withCredentials: true,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user