Implement god mode toggle in NavTop

Featurekamo-internal
ส่งแล้ว
24 ตุลาคม 2568 เวลา 21:01 UTC
ผู้เขียน
snadjafinia
ตั้งค่า
f02f3a8

Backend changes (app/api/user-info/route.ts): - Read GD field from Redis session data - Map to isGod in API response Frontend changes (app/hooks/useUserInfo.tsx): - Add isGod field to UserInfo interface - Add getIsGod() method to hook - Export getIsGod for components UI changes (app/components/NavTop.tsx): - Add god mode toggle (purple theme) - Only visible to users with isGod permission (GD=true) - Toggle state stored in localStorage - Independent on/off control for god mode Flow: 1. User has is_god=true in database 2. SecurityService stores GD=true in Redis session 3. /api/user-info returns isGod=true 4. NavTop shows god mode toggle 5. User can enable/disable god mode (UI state only) Two-level permission: - isGod: Permission to SEE the toggle (from database) - godModeActive: Current UI state (localStorage)

เปลี่ยนแปลงทั้งหมด

เหมือนที่คุณเห็นการขนส่ง?

ทุก คน ที่ ได้ รับ การ ปรับ ปรุง เหล่า นี้ จะ ลง ไป ใน ที่ ทํา งาน ของ คุณ โดย อัตโนมัติ. เริ่มให้อิสระและดูมันเติบโตสัปดาห์แล้วสัปดาห์เล่า.

เริ่ม เป็น อิสระ ตลอด ไปแสดงพริ้นซ์