fix: 应用 xhigh 代码评审的跨端修复
来自 xhigh code review 的正确性/健壮性修复,覆盖全部五端: - server:鉴权 fail-closed、计量交叉校验与配额扣穿处理、WS 网关并发与关闭顺序、 billing 行锁、redis Lua 过期与设备槽刷新、config 解析 - desktop:会话 epoch 防串话、WS 重连与 401 处理、api 客户端复用、统一 usePoll 轮询 - android:握手时序、请求头封装、账户状态派生、按需重组 - ios:finalize 宽限、串行采集、错误文案服务端优先、删除死代码 CommitController Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { createRoot } from 'react-dom/client';
|
||||
import '@dudu/design/styles.css';
|
||||
import { Badge } from '@dudu/design/components/core/Badge';
|
||||
import { invoke, listen } from '../shared/tauri';
|
||||
import { setThemePref } from '../shared/theme';
|
||||
|
||||
function Item({ children, right, onClick }) {
|
||||
const [hover, setHover] = useState(false);
|
||||
@@ -28,6 +29,8 @@ function TrayApp() {
|
||||
const [me, setMe] = useState(null);
|
||||
const [paused, setPaused] = useState(false);
|
||||
useEffect(() => {
|
||||
// 启动应用主题:深色模式下托盘菜单不再停在浅色。
|
||||
invoke('get_settings').then((s) => s && setThemePref(s.theme));
|
||||
invoke('fetch_me').then((m) => m && setMe(m));
|
||||
invoke('is_paused').then((p) => setPaused(!!p));
|
||||
listen('account', ({ payload }) => setMe(payload));
|
||||
|
||||
Reference in New Issue
Block a user