chore: remove unused

This commit is contained in:
Methapon2001 2023-12-15 11:15:15 +07:00
parent 6a5ccc09a5
commit bfe92690c4
No known key found for this signature in database
GPG key ID: 849924FEF46BD132

View file

@ -41,30 +41,6 @@ export interface Structure extends StorageFolder {
type Tree = Structure[]
function constructUrl(path: string | string[], append = true) {
const arr = Array.isArray(path) ? path : path.split('/').filter(Boolean)
const url =
import.meta.env.VITE_API_ENDPOINT +
arr.reduce<string>((a, v, i) => {
switch (String(i)) {
case '0':
return `cabinet/${v}`
case '1':
return `${a}/drawer/${v}`
case '2':
return `${a}/folder/${v}`
case '3':
return `${a}/subfolder/${v}`
default:
return a
}
}, '')
return append
? url + ['cabinet', '/drawer', '/folder', '/subfolder'][arr.length]
: url
}
function consistantPath(path: string | string[]) {
return Array.isArray(path)
? path.join('/') + '/'
@ -512,7 +488,6 @@ const useStorage = defineStore('storageStore', () => {
createFile,
updateFile,
deleteFile,
constructUrl,
consistantPath,
}
})