Skip to content

Commit

Permalink
perf: 文件权限提示点击确定返回主目录
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Mar 31, 2022
1 parent a10d5ee commit 936dee9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/Models/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ public static function permissionFind($id, $limit = 0, &$permission = -1)
if ($permission < $limit) {
$msg = match ($limit) {
1000 => '仅限所有者或创建者操作',
1 => '没有读写权限',
default => '没有访问权限',
1 => '没有修改写入权限',
default => '没有查看访问权限',
};
throw new ApiException($msg);
}
Expand Down
14 changes: 12 additions & 2 deletions resources/assets/js/pages/manage/file.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

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

0 comments on commit 936dee9

Please sign in to comment.