refactor: 清理临时检查文件;用户信息增强与登录页优化

- 删除 INSPECTION.md / TODO.md 等临时检查文档
- 新增 UserCompanySummaryVO:登录用户返回所属公司摘要信息
- UserServiceImpl / UserVO:调整用户信息结构与缓存逻辑
- 前端:登录页布局优化 / 用户下拉组件更新
This commit is contained in:
小蟑螂
2026-05-09 17:11:59 +08:00
parent 3d1f9f2a2a
commit 47cc5dc6d1
13 changed files with 102 additions and 327 deletions
@@ -32,7 +32,10 @@ export namespace AuthApi {
/** 用户信息 */
export interface UserInfo {
id: number;
companyId?: number;
company?: {
id: number;
name: string;
};
departmentId?: number;
positionId?: number;
loginCode: string;
@@ -7,8 +7,11 @@ export namespace UserVO {
export interface UserInfoVO {
/** 用户编号 */
id: number;
/** 公司id */
companyId?: number;
/** 公司摘要(列表为上次所在公司;/user/info 为当前 token 公司) */
company?: {
id: number;
name: string;
};
/** 部门id */
departmentId?: number;
/** 岗位id */
@@ -118,6 +118,22 @@ const avatar = computed(() => {
return userStore.userInfo?.avatar ?? preferences.app.defaultAvatar;
});
/** 当前登录上下文下的公司名称(来自 /user/info 的 company) */
const companyName = computed(() => {
const info = userStore.userInfo as null | { company?: { name?: string } };
const name = info?.company?.name?.trim();
return name || '';
});
/** 用户下拉副标题:第一行手机号,第二行公司名称(不放同一行) */
const userDropdownDescription = computed(() => {
const phone = (userStore.userInfo?.phone || '-').trim() || '-';
if (companyName.value) {
return `${phone}\n${companyName.value}`;
}
return phone;
});
async function handleLogout() {
await authStore.logout(false);
}
@@ -153,7 +169,7 @@ watch(
:avatar
:menus
:text="userStore.userInfo?.realName"
:description="userStore.userInfo?.phone || '-'"
:description="userDropdownDescription"
@logout="handleLogout"
/>
</template>