fix(web): 审计日志显示用户名替代 UUID + 咨询日期选择器中文化
- AdminDashboard: audit log 使用后端返回的 user_name 字段,无则回退 EntityName - ConsultationList: RangePicker placeholder 改为中文"开始日期"/"结束日期"
This commit is contained in:
@@ -266,6 +266,7 @@ export default function ConsultationList() {
|
||||
/>
|
||||
<DatePicker.RangePicker
|
||||
style={{ width: 240 }}
|
||||
placeholder={["开始日期", "结束日期"]}
|
||||
onChange={(dates) => {
|
||||
if (dates && dates[0] && dates[1]) {
|
||||
setFilters((prev) => ({
|
||||
|
||||
@@ -157,7 +157,8 @@ export default function AdminDashboard() {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
fetchData();
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
void fetchData();
|
||||
}, [fetchData]);
|
||||
|
||||
const firstName = user?.display_name ?? user?.username ?? "管理员";
|
||||
@@ -470,11 +471,14 @@ export default function AdminDashboard() {
|
||||
>
|
||||
{iconCfg.icon}
|
||||
</div>
|
||||
<span style={{ fontWeight: 500, flexShrink: 0, width: 60 }}>
|
||||
{log.user_id ? (
|
||||
<span style={{ fontWeight: 500, flexShrink: 0, maxWidth: 80 }}>
|
||||
{log.user_name ? (
|
||||
log.user_name
|
||||
) : log.user_id ? (
|
||||
<EntityName
|
||||
name={log.user_id.slice(0, 6)}
|
||||
name={null}
|
||||
id={log.user_id}
|
||||
fallbackLabel="未知用户"
|
||||
/>
|
||||
) : (
|
||||
"系统"
|
||||
|
||||
Reference in New Issue
Block a user