d1034fc30e99091220ec867785e29e80be5c66b4..96f4f1ea3a088d315a60c65bae50b5074441bf4c
9 days ago chengmw
feat: 更新环境配置文件
96f4f1 diff | tree
9 days ago chengmw
feat: 优化AppHeader用户信息处理,增加URL解码和localStorage存储
529af7 diff | tree
2 files modified
24 ■■■■ changed files
web-app/src/components/common/AppHeader.jsx 22 ●●●● patch | view | raw | blame | history
web-app/src/config/env.js 2 ●●● patch | view | raw | blame | history
web-app/src/components/common/AppHeader.jsx
@@ -17,12 +17,26 @@
 */
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;
};
/**
web-app/src/config/env.js
@@ -12,7 +12,7 @@
};
// 当前环境,默认为SIT测试环境
const CURRENT_ENV = process.env.REACT_APP_ENV || ENV_TYPES.DEV;
const CURRENT_ENV = process.env.REACT_APP_ENV || ENV_TYPES.SIT;
// 环境配置映射
const ENV_CONFIG = {