mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-16 14:12:51 +00:00
fix: 更该文件类型都为 children
This commit is contained in:
parent
95ec53381b
commit
d3a3c34287
@ -1816,23 +1816,23 @@ class UsersController extends AbstractController
|
|||||||
public function share__list()
|
public function share__list()
|
||||||
{
|
{
|
||||||
$user = User::auth();
|
$user = User::auth();
|
||||||
$pid = intval( Request::input('pid',-1) );
|
$pid = intval(Request::input('pid',-1));
|
||||||
$uploadFileId = intval(Request::input('upload_file_id',-1));
|
$uploadFileId = intval(Request::input('upload_file_id',-1));
|
||||||
// 上传文件
|
// 上传文件
|
||||||
if($uploadFileId !== -1 ){
|
if($uploadFileId !== -1){
|
||||||
if($pid==-1) $pid = 0;
|
if($pid==-1) $pid = 0;
|
||||||
$webkitRelativePath = Request::input('webkitRelativePath');
|
$webkitRelativePath = Request::input('webkitRelativePath');
|
||||||
$data = (new File)->contentUpload($user,$pid,$webkitRelativePath);
|
$data = (new File)->contentUpload($user,$pid,$webkitRelativePath);
|
||||||
return Base::retSuccess('success', $data);
|
return Base::retSuccess('success', $data);
|
||||||
}
|
}
|
||||||
// 获取数据
|
// 获取数据
|
||||||
|
$lists = [];
|
||||||
if ($pid !== -1) {
|
if ($pid !== -1) {
|
||||||
$lists = [];
|
|
||||||
$fileList = (new File)->getFileList($user,$pid,'dir',false);
|
$fileList = (new File)->getFileList($user,$pid,'dir',false);
|
||||||
foreach($fileList as $file){
|
foreach($fileList as $file){
|
||||||
if($file['id'] != $pid){
|
if($file['id'] != $pid){
|
||||||
$lists[] = [
|
$lists[] = [
|
||||||
'type' => count((new File)->getFileList($user,$file['id'],'dir',false)) > 0 ? 'children' : 'item',
|
'type' => 'children',
|
||||||
'url' => Base::fillUrl("api/users/share/list") . "?pid=" . $file['id'],
|
'url' => Base::fillUrl("api/users/share/list") . "?pid=" . $file['id'],
|
||||||
'icon' => url("/images/file/light/folder.svg"),
|
'icon' => url("/images/file/light/folder.svg"),
|
||||||
'extend' => ['upload_file_id'=>$file['id']],
|
'extend' => ['upload_file_id'=>$file['id']],
|
||||||
@ -1842,13 +1842,13 @@ class UsersController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$lists = [[
|
$lists[] = [
|
||||||
'type' => 'children',
|
'type' => 'children',
|
||||||
'url' => Base::fillUrl("api/users/share/list")."?pid=0",
|
'url' => Base::fillUrl("api/users/share/list")."?pid=0",
|
||||||
'icon' => url("/images/file/light/folder.svg"),
|
'icon' => url("/images/file/light/folder.svg"),
|
||||||
'extend' => ['upload_file_id'=>0],
|
'extend' => ['upload_file_id'=>0],
|
||||||
'name' => '全部文件',
|
'name' => '全部文件',
|
||||||
]];
|
];
|
||||||
$dialogList = (new WebSocketDialog)->getDialogList($user->userid);
|
$dialogList = (new WebSocketDialog)->getDialogList($user->userid);
|
||||||
foreach($dialogList['data'] as $dialog){
|
foreach($dialogList['data'] as $dialog){
|
||||||
if($dialog['type'] == 'user'){
|
if($dialog['type'] == 'user'){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user