// import axios from "~/http/request"
import request from '@/utils/request';
import useFilePwd from "@/components/file/file/useFilePwd";
let { getPathPwd } = useFilePwd();

// 新建文件夹
export function newFolderReq(data){
    data.password = getPathPwd(data.path);
    return request({
        url: `/api/file/operator/mkdir`,
        method: "post",
        data:data
    })

}
// 批量删除文件/文件夹
export function batchDeleteReq(data){
    return request({
        url: `/api/file/operator/delete/batch`,
        method: "post",
        data:data
    })
}


// 重命名文件
export function renameFileReq(data){
    data.password = getPathPwd(data.path);
    return request({
        url: `/api/file/operator/rename/file`,
        method: "post",
        data:data
    })
}

// 重命名文件夹
export function renameFolderReq(data){
    data.password = getPathPwd(data.path);
    return request({
        url: `/api/file/operator/rename/folder`,
        method: "post",
        data:data
    })
}

// 获取文件上传链接
export function uploadFileReq(data){
    data.password = getPathPwd(data.path);
    return request({
        url: `/api/file/operator/upload/file`,
        method: "post",
        data:data
    })
}