feat(dealer): 添加经销商申请功能并优化用户相关页面

- 新增经销商申请页面和相关组件- 更新用户中心页面,增加经销商状态显示和申请入口
- 修改登录逻辑,支持获取用户手机号- 优化用户钩子,增加获取用户ID和判断超级管理员权限的功能
This commit is contained in:
2025-08-18 01:18:19 +08:00
parent f73bfeb743
commit 13b3d6407b
11 changed files with 376 additions and 46 deletions

View File

@@ -164,6 +164,10 @@ export const useUser = () => {
return user?.avatar || user?.avatarUrl || '';
};
const getUserId = () => {
return user?.userId;
};
// 获取用户显示名称
const getDisplayName = () => {
return user?.nickname || user?.realName || user?.username || '未登录';
@@ -196,6 +200,10 @@ export const useUser = () => {
return user?.isAdmin === true;
};
const isSuperAdmin = () => {
return user?.isSuperAdmin === true;
};
// 获取用户余额
const getBalance = () => {
return user?.balance || 0;
@@ -233,6 +241,8 @@ export const useUser = () => {
isCertified,
isAdmin,
getBalance,
getPoints
getPoints,
getUserId,
isSuperAdmin
};
};