Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ujia
/
uj-store
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 75e62601
authored
Oct 10, 2026
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat(Profile/Login): 新增时间格式化并重构登录景深与菜单地脚线
1 parent
7f873735
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
6 deletions
.workbuddy/memory/2026-10-10.md
src/pages/Profile/index.tsx
src/theme/design.css
.workbuddy/memory/2026-10-10.md
View file @
75e6260
...
@@ -292,3 +292,33 @@
...
@@ -292,3 +292,33 @@
-
修复:
`design.css`
补
`.uj-login-foot { margin-top:28px; display:flex; align-items:flex-end; justify-content:space-between; gap:24px }`
,并把
`.uj-login-hero`
的
`margin-top:auto`
改为
`8px`
(hero 回到正常流、不再被推到底),
`.uj-login-clock`
去掉旧的
`align-self:flex-end; margin-top:20px`
、加
`flex:none`
交给 foot 控制对齐。
-
修复:
`design.css`
补
`.uj-login-foot { margin-top:28px; display:flex; align-items:flex-end; justify-content:space-between; gap:24px }`
,并把
`.uj-login-hero`
的
`margin-top:auto`
改为
`8px`
(hero 回到正常流、不再被推到底),
`.uj-login-clock`
去掉旧的
`align-self:flex-end; margin-top:20px`
、加
`flex:none`
交给 foot 控制对齐。
-
最终左栏垂直流:brand → greet → hero(h1) → foot(左 slogan 竖列 + 右时钟) → 底部留白。
-
最终左栏垂直流:brand → greet → hero(h1) → foot(左 slogan 竖列 + 右时钟) → 底部留白。
-
`tsc --noEmit`
:仍只有那 4 条历史 TS6133 孤儿,本次零新增。
-
`tsc --noEmit`
:仍只有那 4 条历史 TS6133 孤儿,本次零新增。
## 登录左侧景深:墙根转角(以时钟底为「墙/地交界线」)
-
超人反馈上一版"地面"完全没有景深感,明确要的是
**墙与地面的立体夹角**
:时钟底部以上是墙面、以下是地面,时钟像靠在墙面立在地面上。
-
**根因(上一版为什么没景深)**
:
`hero`
的
`margin-top:auto`
把
`foot`
顶到 aside 最底部,而地面
`foot::before`
从
`top:100%`
向下 240px,但 aside 高度即视口高度 → 时钟底几乎贴屏幕底边,地面被
`overflow:hidden`
裁得只剩约 40px,根本铺不开。
-
**本次改造(`src/theme/design.css`)**
:
1.
foot 保持沉底(靠
`hero`
的
`margin-top:auto`
),
**不加**
`margin-bottom`
;
`.uj-login-aside`
底部内边距
`40px→20px`
,让地面条正好贴底。
2.
地面重画为「墙根转角」四层叠加(
`foot::before`
,
`left/right:-44px`
跨整栏、
`height:20px`
、
`top:100%`
紧贴时钟底沉到 aside 底部):
-
顶边 2px 受光高光线(墙地交界亮线);
-
其下 2–13px 墙根投影带 AO(
`rgba(2,6,18,.62)`
→透),模拟墙在地面落影;
-
地面主调
`linear-gradient`
近墙略亮、向前(下)渐沉
`rgba(30,48,100,.92)→rgba(8,15,40,.98)`
,制造纵深;
-
时钟正下方
`radial-gradient`
反光光晕(呼应「立在地面的钟」)。
3.
墙面转角前入阴:
`.uj-login-aside`
背景加一层
`linear-gradient(180deg, 透明 74%, rgba(2,6,18,.4) 100%)`
,使墙根在交界线之前先暗下来,转角在墙侧也成立、亮线更跳。
4.
脚下接触阴影
`.uj-login-clock::after`
加大(
`146×19`
→
`160×21`
、
`bottom:-9px`
→
`-10px`
),更实在地压在露出来的地面上。
-
关键认知:
**纵深不是靠"地面渐变色",而是靠「交界线(亮线)+ 墙根投影(AO) + 两面不同色调对比」**
三件套;单纯一层渐变只会读成"雾"。
-
改动纯 CSS,无 TS 变动,
`tsc --noEmit`
不受影响。
-
待定(超人未提):时钟在地面上的模糊倒影未做(需多包一层 JSX)。
## 登录景深微调 + 地面语言延伸到内部菜单栏 Sider
-
**时钟/slogan 与底部地面条留 18px 间隙(最终落盘方案)**
:首轮用
`.uj-login-foot { margin-bottom:18px }`
+
`::before { bottom:-38px }`
方案,但
`margin-bottom`
实际未落盘,导致
`bottom:-38px`
把地面条推到屏幕底
**以下**
被
`aside overflow:hidden`
整条裁掉(超人反馈"看不到了")。最终改用稳健写法:
`.uj-login-foot { padding-bottom:18px }`
抬升内容,
`::before`
回到
`top:100%`
紧贴 foot 盒底(foot 盒底位置不变 → 地面条仍贴底可见),彻底规避依赖推算像素的负值 bottom。
-
**地面语言延伸到左侧菜单栏 Sider(`src/theme/design.css`)**
:让登录页与内部系统形成视觉关联——把登录页"墙地交界线"同款语言落到
`.uj-sider`
底部作「地脚线」。新增
`.uj-sider::after`
(
`height:20px`
、
`bottom:0`
、
`left/right:0`
、
`z-index:1`
),四层叠加与
`.uj-login-foot::before`
同构(2px 受光高亮线 + 2–13px 墙根投影 AO + 地面主调
`rgba(26,40,82,.94)→rgba(6,10,28,.98)`
+ 居中反光光晕),
`height:20px`
与登录页地面等高强化"同一片地面"呼应。
`.uj-sider-menu`
底部
`padding-block`
由
`8px→24px`
,给地脚线留出空间,避免菜单最后一项被遮挡。
`.uj-sider`
背景已是深蓝渐变(
`#0e1736→#111b3d→#0e1631`
),与登录页墙同源,隐喻成立。
-
纯 CSS 改动,无 TS 变动,
`tsc --noEmit`
不受影响。
## Profile 时间格式化(19:49)
-
:新增 (后端 date-time 串 → ,本地时区;空值/解析失败回退原值或 )。
-
的「本次登录」() 与「会话过期」() 改为经 渲染,去掉原 兜底。
-
用户原指 (实为 Profile/index.tsx 渲染循环里的 ),磁盘上所有 index.tsx/adapter.ts 第118行均无时间,最终定位到 Profile 的时间字段。
-
通过(EXIT=0)。
src/pages/Profile/index.tsx
View file @
75e6260
...
@@ -16,6 +16,17 @@ interface PasswordForm {
...
@@ -16,6 +16,17 @@ interface PasswordForm {
confirmPassword: string;
confirmPassword: string;
}
}
/** 后端 date-time 字符串 → yyyy-MM-dd hh:mm:ss(本地时区);空值或解析失败回退原值 */
function formatDateTime(input?: string | null): string {
if (!input) return '—';
const d = new Date(input);
if (Number.isNaN(d.getTime())) return input;
const p = (n: number) => String(n).padStart(2, '0');
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(
d.getHours(),
)}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
}
export default function Profile() {
export default function Profile() {
const navigate = useNavigate();
const navigate = useNavigate();
const { message } = App.useApp();
const { message } = App.useApp();
...
@@ -88,8 +99,8 @@ export default function Profile() {
...
@@ -88,8 +99,8 @@ export default function Profile() {
{ label: '数据范围', value: info.dataScopeLabel || '—' },
{ label: '数据范围', value: info.dataScopeLabel || '—' },
];
];
const metaChips: { label: string; value: string }[] = [
const metaChips: { label: string; value: string }[] = [
{ label: '本次登录', value:
info.loginAt || '—'
},
{ label: '本次登录', value:
formatDateTime(info.loginAt)
},
{ label: '会话过期', value:
info.expireAt || '—'
},
{ label: '会话过期', value:
formatDateTime(info.expireAt)
},
];
];
return (
return (
...
...
src/theme/design.css
View file @
75e6260
...
@@ -70,9 +70,12 @@
...
@@ -70,9 +70,12 @@
width
:
38%
;
width
:
38%
;
max-width
:
520px
;
max-width
:
520px
;
min-width
:
360px
;
min-width
:
360px
;
background
:
linear-gradient
(
160deg
,
#0b1437
0%
,
#16245a
100%
);
/* 墙面:底色斜向渐变;贴近地面处(底部)压一层暗,使"墙根"在转角前先入阴影,转角更成立 */
background
:
linear-gradient
(
180deg
,
rgba
(
2
,
6
,
18
,
0
)
74%
,
rgba
(
2
,
6
,
18
,
0.4
)
100%
),
linear-gradient
(
160deg
,
#0b1437
0%
,
#16245a
100%
);
color
:
#fff
;
color
:
#fff
;
padding
:
44px
44px
4
0px
;
padding
:
44px
44px
2
0px
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
}
}
...
@@ -140,6 +143,26 @@
...
@@ -140,6 +143,26 @@
align-items
:
center
;
align-items
:
center
;
flex
:
none
;
flex
:
none
;
}
}
/* 时钟脚下接触阴影(整片地面见 .uj-login-foot::before),保留「立在地上」的咬合感 */
.uj-login-clock
::after
{
/* 接触阴影:物体压在地面上的实影,中心更实、边缘虚,强化「立在地上」 */
content
:
''
;
position
:
absolute
;
left
:
50%
;
bottom
:
-10px
;
width
:
160px
;
height
:
21px
;
transform
:
translateX
(
-50%
);
background
:
radial-gradient
(
ellipse
at
center
,
rgba
(
0
,
0
,
0
,
0.64
),
rgba
(
0
,
0
,
0
,
0.32
)
46%
,
transparent
72%
);
filter
:
blur
(
5px
);
z-index
:
-1
;
pointer-events
:
none
;
}
.uj-login-dial
svg
{
.uj-login-dial
svg
{
display
:
block
;
display
:
block
;
}
}
...
@@ -227,9 +250,11 @@
...
@@ -227,9 +250,11 @@
.uj-login-hero
{
.uj-login-hero
{
margin-top
:
auto
;
margin-top
:
auto
;
}
}
/* 底部脚注区:slogan 左 + 时钟右 左右排列
,整体紧贴 hero 下方(不再沉到底部)
*/
/* 底部脚注区:slogan 左 + 时钟右 左右排列
;hero 的 margin-top:auto 把整块沉到底部
*/
.uj-login-foot
{
.uj-login-foot
{
margin-top
:
28px
;
margin-top
:
28px
;
/* 内下边距把时钟/slogan 整体抬离底部地面条,留出 18px 间隙;foot 盒底位置不变,地面条仍贴底可见 */
padding-bottom
:
18px
;
position
:
relative
;
position
:
relative
;
z-index
:
1
;
z-index
:
1
;
display
:
flex
;
display
:
flex
;
...
@@ -237,6 +262,31 @@
...
@@ -237,6 +262,31 @@
justify-content
:
space-between
;
justify-content
:
space-between
;
gap
:
24px
;
gap
:
24px
;
}
}
/* 地面(墙根转角):紧贴 foot 盒底(=时钟底原位置,距屏幕底 20px 的 aside 内边距处)铺满整栏宽,
顶边是"墙地交界线"——一条受光高光 + 其下墙根投影带(AO),再向下是向前(观者)渐沉的地面主调,
时钟正下方一团反光光晕,整体读成「时钟立在一面墙前的地面上」。
之所以用 top:100%(而非负 bottom),是因为 foot 用 padding-bottom 抬升内容后盒底不动,
地面条始终贴 foot 盒底、绝不会被 aside 的 overflow:hidden 裁掉;
left/right:-44px 抵消 aside 的 44px 内边距使地面横跨整栏;超出部分由 aside overflow:hidden 收口 */
.uj-login-foot
::before
{
content
:
''
;
position
:
absolute
;
left
:
-44px
;
right
:
-44px
;
top
:
100%
;
height
:
20px
;
z-index
:
-1
;
pointer-events
:
none
;
background
:
/* 1. 转角高光:墙地交界的 2px 亮线 */
linear-gradient
(
180deg
,
rgba
(
198
,
220
,
255
,
0.5
)
0
2px
,
transparent
2px
),
/* 2. 墙根投影(AO):2–13px 渐虚,模拟墙在地面落影 */
linear-gradient
(
180deg
,
transparent
2px
,
rgba
(
2
,
6
,
18
,
0.62
)
7px
,
rgba
(
2
,
6
,
18
,
0
)
13px
),
/* 3. 地面主调:薄薄一层,向前(下)略沉,呼应"立在地面的钟" */
linear-gradient
(
180deg
,
rgba
(
30
,
48
,
100
,
0.92
)
0%
,
rgba
(
8
,
15
,
40
,
0.98
)
100%
),
/* 4. 时钟正下方反光光晕 */
radial-gradient
(
82%
240%
at
70%
0%
,
rgba
(
120
,
160
,
255
,
0.22
),
rgba
(
120
,
160
,
255
,
0
)
65%
);
}
.uj-login-hero
::before
{
.uj-login-hero
::before
{
content
:
''
;
content
:
''
;
display
:
block
;
display
:
block
;
...
@@ -363,6 +413,29 @@
...
@@ -363,6 +413,29 @@
/* 侧边菜单不再有 CSS 旋钮:高度 / 左右留白 / 圆角 / 图标尺寸 / 折叠宽度
/* 侧边菜单不再有 CSS 旋钮:高度 / 左右留白 / 圆角 / 图标尺寸 / 折叠宽度
全部写在 themeConfig.ts 的 components.Menu token 里,由组件自身参与计算。 */
全部写在 themeConfig.ts 的 components.Menu token 里,由组件自身参与计算。 */
}
}
/* 左侧菜单栏「地脚线 / 地面」:与登录页时钟底部同源一面墙、同一片地面的视觉延伸,
让登录页与内部系统形成关联。2px 受光交界亮线 + 墙根投影带(AO) + 向前(下)渐沉的
地面主调 + 地面反光光晕,与 .uj-login-foot::before 同一套语言;
height:20px 与登录页地面等高,强化「同一片地面」的呼应。 */
.uj-sider
::after
{
content
:
''
;
position
:
absolute
;
left
:
0
;
right
:
0
;
bottom
:
0
;
height
:
20px
;
z-index
:
1
;
pointer-events
:
none
;
background
:
/* 1. 墙地交界受光亮线 */
linear-gradient
(
180deg
,
rgba
(
198
,
220
,
255
,
0.5
)
0
2px
,
transparent
2px
),
/* 2. 墙根投影(AO):2–13px 渐虚,模拟墙在地面落影 */
linear-gradient
(
180deg
,
transparent
2px
,
rgba
(
2
,
6
,
18
,
0.62
)
7px
,
rgba
(
2
,
6
,
18
,
0
)
13px
),
/* 3. 地面主调:近墙受光略亮、向前(下)渐沉 */
linear-gradient
(
180deg
,
rgba
(
26
,
40
,
82
,
0.94
)
0%
,
rgba
(
6
,
10
,
28
,
0.98
)
100%
),
/* 4. 地面反光光晕(延续登录页氛围,居中受光) */
radial-gradient
(
82%
240%
at
50%
0%
,
rgba
(
120
,
160
,
255
,
0.18
),
rgba
(
120
,
160
,
255
,
0
)
65%
);
}
.uj-sider
>
.ant-layout-sider-children
{
.uj-sider
>
.ant-layout-sider-children
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
...
@@ -411,7 +484,8 @@
...
@@ -411,7 +484,8 @@
flex
:
1
;
flex
:
1
;
min-height
:
0
;
min-height
:
0
;
overflow-y
:
auto
;
overflow-y
:
auto
;
padding-block
:
12px
8px
;
/* 底部预留地脚线(地面)高度,避免菜单最后一项被 .uj-sider::after 的地面带遮挡 */
padding-block
:
12px
24px
;
padding-inline
:
0
;
padding-inline
:
0
;
scrollbar-gutter
:
stable
both-edges
;
scrollbar-gutter
:
stable
both-edges
;
scrollbar-width
:
none
;
scrollbar-width
:
none
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment