perf: 文件权限提示点击确定返回主目录

This commit is contained in:
kuaifan 2022-04-01 06:26:52 +08:00
parent a10d5ee43b
commit 936dee9da5
2 changed files with 14 additions and 4 deletions

View File

@ -325,8 +325,8 @@ class File extends AbstractModel
if ($permission < $limit) { if ($permission < $limit) {
$msg = match ($limit) { $msg = match ($limit) {
1000 => '仅限所有者或创建者操作', 1000 => '仅限所有者或创建者操作',
1 => '没有读写权限', 1 => '没有修改写入权限',
default => '没有访问权限', default => '没有查看访问权限',
}; };
throw new ApiException($msg); throw new ApiException($msg);
} }

View File

@ -23,7 +23,7 @@
<div class="file-navigator"> <div class="file-navigator">
<ul> <ul>
<li @click="[pid=0,searchKey='']">{{$L('全部文件')}}</li> <li @click="backHomeDirectory">{{$L('全部文件')}}</li>
<li v-if="searchKey">{{$L('搜索')}} "{{searchKey}}"</li> <li v-if="searchKey">{{$L('搜索')}} "{{searchKey}}"</li>
<li v-else v-for="item in navigator" @click="pid=item.id"> <li v-else v-for="item in navigator" @click="pid=item.id">
<i v-if="item.share" class="taskfont">&#xe63f;</i> <i v-if="item.share" class="taskfont">&#xe63f;</i>
@ -814,14 +814,24 @@ export default {
return name; return name;
}, },
backHomeDirectory() {
this.pid = 0
this.searchKey = ''
},
getFileList() { getFileList() {
this.loadIng++; this.loadIng++;
this.$store.dispatch("getFiles", this.pid).then(() => { this.$store.dispatch("getFiles", this.pid).then(() => {
this.loadIng--; this.loadIng--;
$A.setStorage("fileOpenPid", this.pid) $A.setStorage("fileOpenPid", this.pid)
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg);
this.loadIng--; this.loadIng--;
$A.modalError({
content: msg,
onOk: () => {
this.backHomeDirectory();
}
});
}); });
}, },