diff --git a/app/Http/Controllers/Api/FileController.php b/app/Http/Controllers/Api/FileController.php index e8067515e..199606760 100755 --- a/app/Http/Controllers/Api/FileController.php +++ b/app/Http/Controllers/Api/FileController.php @@ -47,8 +47,7 @@ class FileController extends AbstractController { $user = User::auth(); // - $data = Request::all(); - $pid = intval($data['pid']); + $pid = intval(Request::input('pid')); // return Base::retSuccess('success', (new File)->getFileList($user, $pid)); } diff --git a/app/Models/File.php b/app/Models/File.php index 17cdfa59c..04d866d48 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -111,6 +111,8 @@ class File extends AbstractModel * 获取文件列表 * @param user $user * @param int $pid + * @param string $type + * @param bool $isGetparent * @return array */ public function getFileList($user, int $pid, $type = "all", $isGetparent = true) @@ -118,7 +120,7 @@ class File extends AbstractModel $permission = 1000; $userids = $user->isTemp() ? [$user->userid] : [0, $user->userid]; $builder = File::wherePid($pid) - ->when($type=='dir',function($q){ + ->when($type == 'dir', function ($q) { $q->whereType('folder'); }); if ($pid > 0) { @@ -134,7 +136,7 @@ class File extends AbstractModel // if ($pid > 0) { // 遍历获取父级 - if($isGetparent){ + if ($isGetparent) { while ($pid > 0) { $file = File::whereId($pid)->first(); if (empty($file)) { @@ -172,8 +174,8 @@ class File extends AbstractModel ->whereIn('file_users.userid', $userids) ->groupBy('files.id') ->take(100) - ->when($type=='dir',function($q){ - $q->where('files.type','folder'); + ->when($type == 'dir', function ($q) { + $q->where('files.type', 'folder'); }) ->get(); if ($list->isNotEmpty()) { diff --git a/electron/electron.js b/electron/electron.js index 89f3d65c0..82f6af2f0 100644 --- a/electron/electron.js +++ b/electron/electron.js @@ -351,6 +351,7 @@ function createChildWindow(args) { browser = preloadWindow; preloadWindow = null; isPreload = true; + options.title && browser.setTitle(options.title); options.parent && browser.setParentWindow(options.parent); browser.setSize(options.width, options.height); browser.setMinimumSize(options.minWidth, options.minHeight); diff --git a/resources/assets/js/pages/manage/messenger.vue b/resources/assets/js/pages/manage/messenger.vue index f2bd54519..66cd4e6ba 100644 --- a/resources/assets/js/pages/manage/messenger.vue +++ b/resources/assets/js/pages/manage/messenger.vue @@ -530,7 +530,7 @@ export default { }, searchLoading({tabActive, loadDialogs, dialogSearchLoad, contactsLoad}) { - if (tabActive==='dialog') { + if (tabActive === 'dialog') { return loadDialogs > 0 || dialogSearchLoad > 0 } else { return contactsLoad > 0 @@ -696,7 +696,7 @@ export default { return } this.$nextTick(_ => { - $A.scrollToView(this.$refs.navList?.querySelector('.active'), { behavior: "auto", block: "nearest", inline: "nearest" }); + $A.scrollToView(this.$refs.navList?.querySelector('.active'), {behavior: "auto", block: "nearest", inline: "nearest"}); }) }, @@ -895,7 +895,7 @@ export default { }).then(({data}) => { const msgIds = []; const lists = []; - this.dialogList.forEach(h=>{ + this.dialogList.forEach(h => { lists.push(h); msgIds.push(h.search_msg_id) }); @@ -989,7 +989,7 @@ export default { formatDraft(value) { return value?.replace(/]*>/gi, `[${$A.L('图片')}]`) .replace(/<[^>]*>/g, '') - .replace(/ /g, ' ')|| null + .replace(/ /g, ' ') || null }, formatTodoNum(num) { @@ -1004,7 +1004,7 @@ export default { }, showProfessionDesc(dialog_user) { - if (dialog_user) { + if (dialog_user && dialog_user.profession) { return `[${dialog_user.profession}]` } return '' diff --git a/resources/assets/sass/pages/common.scss b/resources/assets/sass/pages/common.scss index 6704ffc56..d4182bbb7 100755 --- a/resources/assets/sass/pages/common.scss +++ b/resources/assets/sass/pages/common.scss @@ -877,6 +877,7 @@ body.window-portrait { margin-right: 4px; } > em { + display: inline-block; margin-right: 4px; cursor: pointer; color: #2b85e4;