mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
Feat: 对接删除/创建目录对象
This commit is contained in:
parent
3933ed44c6
commit
8f73231e26
|
|
@ -10,7 +10,7 @@ import {
|
|||
} from "../../actions/index"
|
||||
import PathSelector from "./PathSelector"
|
||||
import axios from 'axios'
|
||||
|
||||
import API from "../../middleware/Api"
|
||||
import {
|
||||
withStyles,
|
||||
Button,
|
||||
|
|
@ -169,14 +169,12 @@ class ModalsCompoment extends Component {
|
|||
items.push(value.path === "/" ? value.path+value.name:value.path+"/"+value.name);
|
||||
}
|
||||
});
|
||||
axios.post('/File/Delete', {
|
||||
action: 'delete',
|
||||
API.delete('/object', { data: {
|
||||
items: items,
|
||||
dirs:dirs,
|
||||
newPath:this.state.selectedPath === "//"?"/":this.state.selectedPath,
|
||||
})
|
||||
}})
|
||||
.then( (response)=> {
|
||||
if(response.data.result.success){
|
||||
if(response.rawData.code == 0){
|
||||
this.onClose();
|
||||
this.props.refreshFileList();
|
||||
}else{
|
||||
|
|
@ -290,17 +288,12 @@ class ModalsCompoment extends Component {
|
|||
this.props.toggleSnackbar("top","right","文件夹名称重复","warning");
|
||||
this.props.setModalsLoading(false);
|
||||
}else{
|
||||
axios.post('/File/createFolder', {
|
||||
action: '"createFolder"',
|
||||
newPath: (this.props.path === "/"?"":this.props.path)+"/"+this.state.newFolderName,
|
||||
API.put('/directory', {
|
||||
path: (this.props.path === "/"?"":this.props.path)+"/"+this.state.newFolderName,
|
||||
})
|
||||
.then( (response)=> {
|
||||
if(response.data.result.success){
|
||||
this.onClose();
|
||||
this.props.refreshFileList();
|
||||
}else{
|
||||
this.props.toggleSnackbar("top","right",response.data.result.error,"warning");
|
||||
}
|
||||
this.onClose();
|
||||
this.props.refreshFileList();
|
||||
this.props.setModalsLoading(false);
|
||||
|
||||
})
|
||||
|
|
|
|||
|
|
@ -184,11 +184,7 @@ class NavigatorCompoment extends Component {
|
|||
var newPath = path!==null?path:this.props.path;
|
||||
var apiURL = this.keywords===null?'/directory':'/File/SearchFile';
|
||||
newPath = this.keywords===null?newPath:this.keywords;
|
||||
API.get(apiURL, {
|
||||
params: {
|
||||
path: newPath,
|
||||
}
|
||||
})
|
||||
API.get(apiURL+newPath,)
|
||||
.then( (response)=> {
|
||||
this.props.updateFileList(response.data);
|
||||
this.props.setNavigatorLoadingStatus(false);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ instance.interceptors.response.use(
|
|||
function(response) {
|
||||
response.rawData = response.data;
|
||||
response.data = response.data.data;
|
||||
if (response.rawData.code != 0){
|
||||
if (response.rawData.code != 0 && response.rawData.code != 203 ){
|
||||
// 登录过期
|
||||
if (response.rawData.code == 401){
|
||||
Auth.signout();
|
||||
|
|
|
|||
Loading…
Reference in New Issue