feat(game): 更新游戏页面功能和认证刷新机制
- 将开发环境代理目标从 192.168.1.5 改为 127.0.0.1 - 重构 auth.ts 文件中的代码缩进格式 - 实现自动令牌刷新机制,支持 JWT 过期时间检测 - 添加 WebSocket 连接的令牌强制刷新逻辑 - 新增 WindSquare 组件显示方位风向图标 - 实现动态座位风向计算和显示功能 - 优化 WebSocket URL 构建方式,移除查询参数中的令牌传递 - 添加登录失效时自动跳转到登录页面的功能 - 限制玩家名称显示长度为4个字符 - 改进 WebSocket 错误处理和重连机制
This commit is contained in:
BIN
src/assets/images/direction/bei.png
Executable file
BIN
src/assets/images/direction/bei.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
BIN
src/assets/images/direction/dong.png
Executable file
BIN
src/assets/images/direction/dong.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/assets/images/direction/nan.png
Executable file
BIN
src/assets/images/direction/nan.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
BIN
src/assets/images/direction/xi.png
Executable file
BIN
src/assets/images/direction/xi.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
1
src/assets/images/icons/triangle.svg
Normal file
1
src/assets/images/icons/triangle.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1774491457300" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6759" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M535.466667 812.8l450.133333-563.2c14.933333-19.2 2.133333-49.066667-23.466667-49.066667H61.866667c-25.6 0-38.4 29.866667-23.466667 49.066667l450.133333 563.2c12.8 14.933333 34.133333 14.933333 46.933334 0z" fill="#ffffff" p-id="6760"></path></svg>
|
||||
|
After Width: | Height: | Size: 581 B |
@@ -746,225 +746,6 @@ button:disabled {
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.table-watermark {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 24px;
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
color: rgba(244, 240, 220, 0.82);
|
||||
text-align: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.table-watermark span {
|
||||
font-size: 12px;
|
||||
color: #f7e4b0;
|
||||
}
|
||||
|
||||
.table-watermark strong {
|
||||
font-size: 26px;
|
||||
letter-spacing: 2px;
|
||||
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.table-watermark small {
|
||||
font-size: 12px;
|
||||
color: #bdd8ca;
|
||||
}
|
||||
|
||||
.player-badge {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-width: 154px;
|
||||
padding: 9px 12px;
|
||||
border-radius: 16px;
|
||||
border: 1px solid rgba(248, 226, 173, 0.24);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(43, 52, 73, 0.84), rgba(17, 22, 34, 0.82)),
|
||||
radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 40%);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.08),
|
||||
0 12px 28px rgba(0, 0, 0, 0.24);
|
||||
}
|
||||
|
||||
.avatar-panel {
|
||||
position: relative;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.player-badge.seat-top {
|
||||
top: 20px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.player-badge.seat-right {
|
||||
right: -20px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%) rotate(90deg);
|
||||
}
|
||||
|
||||
.player-badge.seat-bottom {
|
||||
bottom: 20px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.player-badge.seat-left {
|
||||
left: -20px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%) rotate(90deg);
|
||||
}
|
||||
|
||||
.player-badge.is-turn {
|
||||
border-color: rgba(244, 222, 163, 0.72);
|
||||
}
|
||||
|
||||
.player-badge.offline {
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.avatar-card {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgba(255, 248, 215, 0.32);
|
||||
background:
|
||||
linear-gradient(145deg, #b3e79c, #4eaf4a 46%, #2f7e28 100%);
|
||||
color: #f7fff7;
|
||||
font-weight: 800;
|
||||
box-shadow:
|
||||
inset 0 2px 4px rgba(255, 255, 255, 0.18),
|
||||
0 6px 14px rgba(0, 0, 0, 0.22);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-card img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.player-badge.seat-right .avatar-card img {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.player-badge.seat-left .avatar-card img {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.player-meta p {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: #eef5ff;
|
||||
}
|
||||
|
||||
.player-meta strong {
|
||||
font-size: 15px;
|
||||
color: #ffd85c;
|
||||
text-shadow: 0 0 10px rgba(255, 216, 92, 0.2);
|
||||
}
|
||||
|
||||
.dealer-mark,
|
||||
.missing-mark {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.dealer-mark {
|
||||
position: absolute;
|
||||
right: -8px;
|
||||
bottom: -6px;
|
||||
background: linear-gradient(180deg, #ffe38a 0%, #f1b92e 100%);
|
||||
color: #5f3200;
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.missing-mark {
|
||||
margin-left: auto;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(180deg, rgba(114, 219, 149, 0.2) 0%, rgba(21, 148, 88, 0.34) 100%);
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.16);
|
||||
}
|
||||
|
||||
.missing-mark img {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.missing-mark span {
|
||||
color: #effff5;
|
||||
}
|
||||
|
||||
.wall {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.22));
|
||||
}
|
||||
|
||||
.wall img {
|
||||
display: block;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.wall-top,
|
||||
.wall-bottom {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.wall-left,
|
||||
.wall-right {
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.wall-top {
|
||||
top: 154px;
|
||||
}
|
||||
|
||||
.wall-top img,
|
||||
.wall-bottom img {
|
||||
width: 24px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.wall-right {
|
||||
right: 132px;
|
||||
}
|
||||
|
||||
.wall-left {
|
||||
left: 132px;
|
||||
}
|
||||
|
||||
.wall-left img,
|
||||
.wall-right img {
|
||||
width: 36px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.wall-bottom {
|
||||
bottom: 176px;
|
||||
}
|
||||
|
||||
.center-deck {
|
||||
position: absolute;
|
||||
|
||||
@@ -393,6 +393,10 @@
|
||||
border-color: rgba(244, 222, 163, 0.72);
|
||||
}
|
||||
|
||||
.picture-scene .player-badge.offline {
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.picture-scene .avatar-card {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
@@ -425,6 +429,22 @@
|
||||
color: #eef5ff;
|
||||
}
|
||||
|
||||
.picture-scene .player-badge.seat-right .player-meta,
|
||||
.picture-scene .player-badge.seat-left .player-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 48px;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.picture-scene .player-badge.seat-right .player-meta p,
|
||||
.picture-scene .player-badge.seat-left .player-meta p {
|
||||
line-height: 1;
|
||||
letter-spacing: 1px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.picture-scene .dealer-mark,
|
||||
.picture-scene .missing-mark {
|
||||
display: inline-flex;
|
||||
@@ -461,6 +481,10 @@
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.picture-scene .missing-mark span {
|
||||
color: #effff5;
|
||||
}
|
||||
|
||||
.wall {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
@@ -542,6 +566,15 @@
|
||||
left: 110px;
|
||||
}
|
||||
|
||||
.center-wind-square {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 3;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.center-desk {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
|
||||
Reference in New Issue
Block a user