front ui fix

This commit is contained in:
2026-05-13 14:39:57 +08:00
parent 9e42918d5e
commit 28eb17f60b
6 changed files with 54 additions and 23 deletions
@@ -35,24 +35,6 @@ public class RestMsgController extends BaseController {
@Autowired
private IUsersService usersService;
// ─── Debug (TEMP) ─────────────────────────────────────────────────────
/** Temp debug: returns raw message counts and inbox list for current user. */
@GetMapping("/debug/inbox")
public ApiResponse<Map<String, Object>> debugInbox(HttpServletRequest request) {
UserInfo user = getUserInfo(request);
if (user == null) return ApiResponse.fail(401, "请先登录");
long unread = messageService.countUnread(user.getId());
List<Message> inbox = messageService.getInbox(user.getId());
return ApiResponse.ok(Map.of(
"userId", user.getId(),
"username", user.getUsername(),
"unreadCount", unread,
"inboxSize", inbox.size(),
"inbox", inbox
));
}
// ─── User card (public — accessible to any authenticated user) ────────
/** Returns basic user info for the hover card (discussionsCount, commentsCount). */
@@ -17,8 +17,40 @@
--border: rgba(255, 255, 255, 0.1);
}
/* ── Global reset ─────────────────────────────────────────────────────────── */
html, body { margin: 0; padding: 0; }
body { background-color: var(--bg-page) !important; color: var(--text-primary); }
/* ── Sticky header (CSS sticky — works on all pages) ─────────────────────── */
#menu.ui.menu {
position: sticky;
top: 0;
z-index: 999;
box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
/* ── Back-to-top button ───────────────────────────────────────────────────── */
#backToTop {
position: fixed;
bottom: 32px;
right: 32px;
width: 42px;
height: 42px;
border-radius: 50%;
background: var(--accent);
color: #fff;
border: none;
cursor: pointer;
display: none;
align-items: center;
justify-content: center;
font-size: 1.2em;
box-shadow: 0 2px 8px rgba(0,0,0,.2);
z-index: 1000;
transition: opacity .2s;
}
#backToTop:hover { opacity: .85; }
/* Apply card background where Semantic UI uses white */
[data-theme="dark"] .ui.card,
[data-theme="dark"] .ui.segment,
+18 -1
View File
@@ -1,7 +1,7 @@
<div class="ui main menu" id="menu">
<div class="ui container">
<div href="/" class="header borderless item">
<img class="logo" src="static/assets/images/logo.png">
<img class="logo" src="/static/assets/images/logo.png">
&nbsp;Jiscuss
</div>
<a class=" item borderless" href="/">首页</a>
@@ -107,6 +107,23 @@
updateBadges();
setInterval(updateBadges, 60000); // refresh every 60s
}
// NProgress — stop loading bar when page is ready
if (typeof NProgress !== 'undefined') NProgress.done();
// Back-to-top button
var $top = document.getElementById('backToTop');
if ($top) {
window.addEventListener('scroll', function() {
$top.style.display = window.scrollY > 300 ? 'flex' : 'none';
});
$top.addEventListener('click', function() {
window.scrollTo({ top: 0, behavior: 'smooth' });
});
}
});
})();
</script>
<#-- 全局返回顶部按钮 -->
<button id="backToTop" title="返回顶部"><i class="angle up icon" style="margin:0;"></i></button>
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<title>与 ${otherUsername} 的对话 - Jiscuss</title>
<head>
<title>与 ${otherUsername} 的对话 - Jiscuss</title>
<meta name="_csrf" content="${_csrf.token}"/>
<meta name="_csrf_header" content="${_csrf.headerName}"/>
<#include "comm/commjs.ftl"/>
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<title>通知 - Jiscuss</title>
<head>
<title>通知 - Jiscuss</title>
<meta name="_csrf" content="${_csrf.token}"/>
<meta name="_csrf_header" content="${_csrf.headerName}"/>
<#include "comm/commjs.ftl"/>
+1 -1
View File
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<title>${username!}的个人主页 - Jiscuss</title>
<head>
<title>${username!}的个人主页 - Jiscuss</title>
<meta name="_csrf" content="${_csrf.token}"/>
<meta name="_csrf_header" content="${_csrf.headerName}"/>
<#include "comm/commjs.ftl"/>