shimai
7 days ago d100657dacb25df91013ef25432620e6ae10d1f8
web-app/src/components/common/AppHeader.jsx
@@ -10,19 +10,33 @@
import './AppHeader.css';
// 默认头像
const DEFAULT_AVATAR = 'http://gz.hugeinfo.com.cn/dyh/wx414ae04ac3f10b4e/images/pngAI_logo.png';
const DEFAULT_AVATAR = '/app_logo.png';
/**
 * 从URL参数获取调解员信息
 */
const getMediatorInfo = () => {
  const params = getMergedParams();
  return {
    trueName: params.trueName || '调解员',
    unit: params.unit || '',
    roleName: params.roleName || '管理员',
  const userInfo = {
    userId: params.userId || '',
    roleId: params.roleId || '',
    auth_token: params.auth_token || '',
    unitType: params.unitType || '',
    trueName: params.trueName ? decodeURIComponent(params.trueName) : '调解员',
    unit: params.unit ? decodeURIComponent(params.unit) : '',
    unitRegion: params.unitRegion ? decodeURIComponent(params.unitRegion) : '',
    roleName: params.roleName ? decodeURIComponent(params.roleName) : '管理员',
    avatar: params.avatar || ''
  };
  // 存储到 localStorage
  try {
    localStorage.setItem('userInfo', JSON.stringify(userInfo));
  } catch (error) {
    console.error('Failed to save userInfo to localStorage:', error);
  }
  return userInfo;
};
/**