Commit eb398902 by wufan

fix:修复文件夹权限问题

parent 9f7f5065
...@@ -105,8 +105,43 @@ class FolderManage extends React.Component { ...@@ -105,8 +105,43 @@ class FolderManage extends React.Component {
_params.current = isSearch ? 1 : current; _params.current = isSearch ? 1 : current;
if (parentRights) { if (parentRights) {
this.setState({ _parentRights: parentRights }); this.setState({ _parentRights: parentRights },()=>{
Service.Hades(FOLDERLIST_URL_MAP[disk], _params).then((res) => {
const { result = {} } = res;
const { records = [], total = 0 } = result;
let _records = [];
// 判断是否继承了父级文件权限
if (records.length > 0 && !records[0].rights) {
// debugger
records.map((item,index) => {
item.rights = parentRights;
_records.push(item);
return _records;
})
this.setState({
loading: false,
folderList: _records,
totalCount: Number(total),
selectedFileIds: [], // 删除之后需要将已经选择的文件清空
selectedFileRights: []
});
} else {
this.setState({
loading: false,
folderList: records,
totalCount: Number(total),
selectedFileIds: [], // 删除之后需要将已经选择的文件清空
selectedFileRights: []
});
} }
}).catch((error)=>{
this.setState({
loading: false,
})
});
});
} else {
Service.Hades(FOLDERLIST_URL_MAP[disk], _params).then((res) => { Service.Hades(FOLDERLIST_URL_MAP[disk], _params).then((res) => {
const { result = {} } = res; const { result = {} } = res;
const { records = [], total = 0 } = result; const { records = [], total = 0 } = result;
...@@ -114,6 +149,7 @@ class FolderManage extends React.Component { ...@@ -114,6 +149,7 @@ class FolderManage extends React.Component {
// 判断是否继承了父级文件权限 // 判断是否继承了父级文件权限
if (records.length > 0 && !records[0].rights) { if (records.length > 0 && !records[0].rights) {
// debugger
records.map((item,index) => { records.map((item,index) => {
item.rights = _parentRights; item.rights = _parentRights;
_records.push(item); _records.push(item);
...@@ -140,6 +176,9 @@ class FolderManage extends React.Component { ...@@ -140,6 +176,9 @@ class FolderManage extends React.Component {
loading: false, loading: false,
}) })
}); });
}
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment