Skip to content

Commit

Permalink
perf: 修复一些问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Jan 21, 2024
1 parent c8b8cc5 commit 8f4399d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,9 @@ public function search()
$list->transform(function (User $userInfo) use ($user, $state) {
$tags = [];
$dep = $userInfo->getDepartmentName();
$dep = array_filter(explode(",", $dep), function($item) {
$dep = array_values(array_filter(explode(",", $dep), function($item) {
return preg_match("/\(M\)$/", $item);
});
}));
if ($dep) {
$tags[] = preg_replace("/\(M\)$/", "", trim($dep[0])) . Doo::translate("负责人");
}
Expand Down
1 change: 1 addition & 0 deletions app/Models/WebSocketDialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public static function getDialogUnread($userid, $beforeAt, $take = 20)
$list = WebSocketDialog::select(['web_socket_dialogs.*', 'u.top_at', 'u.mark_unread', 'u.silence', 'u.color', 'u.updated_at as user_at'])
->join('web_socket_dialog_users as u', 'web_socket_dialogs.id', '=', 'u.dialog_id')
->join('web_socket_dialog_msg_reads as r', 'web_socket_dialogs.id', '=', 'r.dialog_id')
->where('u.userid', $userid)
->where('r.userid', $userid)
->where('r.silence', 0)
->where('r.read_at')
Expand Down
3 changes: 1 addition & 2 deletions resources/assets/sass/components/report.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
flex-shrink: 0;
font-size: 16px;
font-weight: bold;
margin-bottom: 12px;
padding: 20px 24px;
border-bottom: 1px solid #eeeeee;
@media (max-width: 500px) {
Expand All @@ -77,7 +76,7 @@
.report-detail-context {
flex: 1;
height: 0;
padding: 12px 0 12px 24px;
padding: 24px;
display: flex;
flex-direction: column;
overflow: auto;
Expand Down
6 changes: 5 additions & 1 deletion resources/assets/statics/public/js/loading-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ let themeName = window.localStorage.getItem('__system:themeConf__')
if (!['dark', 'light'].includes(themeName)) {
let isDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
if (/eeui/i.test(window.navigator.userAgent)) {
isDark = /system_theme\/dark;/i.test(window.navigator.userAgent)
if (typeof requireModuleJs === 'function') {
isDark = requireModuleJs("eeui").getThemeName() === 'dark'
} else {
isDark = /system_theme\/dark;/i.test(window.navigator.userAgent)
}
}
themeName = isDark ? 'dark' : 'light'
}
Expand Down

0 comments on commit 8f4399d

Please sign in to comment.