mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-08 02:17:04 +00:00
perf: 优化重复共享提示
This commit is contained in:
parent
6b2b072e16
commit
a48a1210c8
@ -845,8 +845,10 @@ class FileController extends AbstractController
|
||||
return Base::retError('仅限所有者操作');
|
||||
}
|
||||
//
|
||||
if ($file->isNnShare()) {
|
||||
return Base::retError('已经处于共享文件夹中');
|
||||
$share = $file->isNnShare();
|
||||
if ($share) {
|
||||
$typeCn = $file->type === 'folder' ? '文件夹' : '文件';
|
||||
return Base::retError("此{$typeCn}已经处于【{$share->name}】共享文件夹中,无法重复共享");
|
||||
}
|
||||
//
|
||||
if (!is_array($userids) || empty($userids)) {
|
||||
|
||||
@ -142,7 +142,7 @@ class File extends AbstractModel
|
||||
|
||||
/**
|
||||
* 是否处于共享文件夹内(不含自身)
|
||||
* @return bool
|
||||
* @return File|false
|
||||
*/
|
||||
public function isNnShare()
|
||||
{
|
||||
@ -153,7 +153,7 @@ class File extends AbstractModel
|
||||
break;
|
||||
}
|
||||
if ($row->share) {
|
||||
return true;
|
||||
return $row;
|
||||
}
|
||||
$pid = $row->pid;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user